Commit Graph

2154 Commits

Author SHA1 Message Date
Antioch Peverell 751ca06560 bump version number (#3066) 2019-09-30 10:58:49 +01:00
Yeastplume f86eb18a6e Change tui tx_pool lock to try_read, only lock once (#3063) 2019-09-28 17:24:40 +01:00
Quentin Le Sceller 142dfb10ac Update zeroize to 0.9.3 (#3062)
* Update zeroize to 0.9.3

* Update zeroize_derive to 0.9.3
2019-09-26 12:27:46 -04:00
Quentin Le Sceller 213daf72ca Add missing doc and route for Node API (#3059)
* Add missing doc and route for Node API
2019-09-26 11:44:44 -04:00
Antioch Peverell fc4e2985d5 add block_hash to head_info so we can easily use them later (#3060) 2019-09-26 14:59:03 +01:00
Antioch Peverell b8946908ff we want to avoid unwrap in get_server_stats (#3058) 2019-09-26 14:01:23 +01:00
Yeastplume ae556a8a2a change release versioning for 2.1.0 beta build (#3056) 2019-09-24 13:54:12 +01:00
Quentin Le Sceller 84172216a5 Timeout after 20 seconds (#3054) 2019-09-24 09:57:58 +01:00
Antioch Peverell 973a03c826 support for v2 txhashset (but only using v1 in mainnent and floonet) (#3051) 2019-09-24 09:57:34 +01:00
Antioch Peverell 1c072f535c DB v1->v2 migration (#3044)
* wip

* exhaustive match

* wip

* cleanup docs and move migration fns to chain itself
2019-09-19 21:00:14 +01:00
Joseph Goulden 02cee80229 fix: Add some more stats to basic status page of TUI (disk usage, chain timestamp, tx pool size) (#3046)
* fix: Add some more stats to basic status page of TUI (disk usage, chain timestamp, tx pool size)

* chore: add latest header timestamp to TUI

* fix: calculate total disk usage of database to show in TUI
2019-09-19 20:57:26 +01:00
Antioch Peverell f3baceb51b bump version for 2.1.0 dev (still on master) (#3050) 2019-09-19 15:03:44 +01:00
Antioch Peverell bc6108cf12 Kernels v2 (variable size) (#3034)
* wip

* exhaustive match

* write with fixed v1 strategy when writing for hashing

* local protocol version is 2

* cleanup "size" tests that exercise v1 vs v2 vs default protocol versions

* add proto version to Connected! log msg

* cleanup docs

* negotiate protocol version min(local, peer) when doing hand/shake
2019-09-19 14:31:46 +01:00
Quentin Le Sceller b209244d17 Add sync_status in status Node API (#2966)
* Add sync_status in status Node API
2019-09-17 11:12:42 -04:00
Antioch Peverell 28d5ee8242 Peer is_known robustness (#3040)
* add some test coverage around peers map (peer_addr hashing impl)

* make is_known a bit more robust

* fix typos
2019-09-12 21:04:09 +01:00
Yeastplume 95004a4b96 BasicAuthMiddleware: Add option to ignore authentication for a particular URI (#3037)
* api::BasicAuthMiddleware: Add option to ignore authentication for a particular URI

* rustfmt
2019-09-12 11:35:18 +01:00
Antioch Peverell 32286ccd7a add some test coverage around peers map (peer_addr hashing impl) (#3039) 2019-09-12 10:37:29 +01:00
Nikolay Volf 108b640c22 Update mmr.md (#3024) 2019-09-10 16:50:10 +01:00
hashmap d90b1c2723 Optimize POW read (#3035)
* Optimize POW read

This functionality is used to deserialize header (from network or from
DB), it was taking up to 40% cpu time during initial header sync. This
PR brings it down to 3-4%. Function read_number would look better as
closure, unfortunately the compliler doesn't inline it in this case, so
it would be 2x slower.

* Remove unused code
2019-09-10 15:14:33 +02:00
hashmap 80a8f76c4c Optimize Option to Error conversion (#3036)
To convert option to error we generate an error message. In some places
it contains header or block hash code or other data which is costly to
produce. So during the initial header sync we spend 12% of all time on
generating those messages (in 99% cases we don't use it). This PR
introduces a lazy generation of error messages which completely
eliminates CPU load during the header sync.
2019-09-10 14:38:36 +02:00
Gary Yu 4faac470d4 fix: the cpuload 100% in case the tcpstream WouldBlock (#3029)
* fix: the cpuload 100% in case the tcpstream WouldBlock

* extending the sleep on WouldBlock to all read/write

* rustfmt
2019-09-10 07:55:57 +08:00
Gary Yu 7a07541c26 Clean the unused build_index (#3026) 2019-09-10 07:55:24 +08:00
Gary Yu fa0fed9de5 fix: find common header between the header chain and the current body chain (#3033)
* fix: find common header between the header chain and the current body chain

* add some code comments
2019-09-10 07:54:42 +08:00
Antioch Peverell 383985292c Split header MMR (and sync MMR) out from txhashset (#3004)
* wip

* sync sort of works now

* get rid of the deadlock during compaction
there is *always* a deadlock in there when we make changes like this...

* cleanup how we rebuild the sync MMR on init

* cleanup rewind logic

* roll the "fix invalid root" changes into this PR

* move rebuild_height_pos_index into txhashset
and pass in header_pmmr for header lookups

* cleanup and remember to setup sync head on init

* cleanup unnecessary ref muts

* rebuild_height_pos_index when writing txhashset
2019-09-07 07:28:26 +08:00
Gary Yu d55ebe8a2b fix: the race condition in compact (#3015) 2019-09-04 19:51:28 +01:00
Tengfei Niu 7aa27652b7 refactor code (#2990)
refactor: refactor code.
2019-09-04 09:53:05 -04:00
Antioch Peverell b291467b96 use head (not header_head) when rewinding full blocks (#3017)
* use head (not header_head) when rewinding to find fork point for full blocks

* get rid of shortcut when nothing to rewind - always something to rewind
2019-09-04 08:02:45 +08:00
jaspervdm 0e62b7e43e Optionally add rangeproofs to block api (#2999) 2019-09-03 15:52:33 +01:00
Gary Yu 928279a676 schnorr signature batch verification (#2961)
* schnorr signature batch verification

* Split the fee and lock_height verification out from the batch signature verification

* Remove the new added fee_height_verify to comply with #2859

* fix: the last n could not be leaf?
2019-09-03 15:44:10 +01:00
jackiszhp 2cebdc5868 it was miscounted (#3013) 2019-09-02 10:13:46 +01:00
jaspervdm 30156cdcf9 Kernel lookup api method (#3000)
* Kernel lookup api

* Min and max height parameters, scan backwards

* Return null instead of 404 if kernel not found

* Return TxKernel instead of TxKernelPrintable

* Update description of KernelHandler
2019-08-30 10:03:12 +01:00
Gary Yu d36a0b29ef store both mmr index and block height into database for output (#2903)
* store both mmr index and block height into database for output

* rustfmt

* fix: mmr position is 1-based instead of 0-based

* (Hash, u64, u64) deserves a type
2019-08-29 17:14:39 +01:00
Antioch Peverell 97f961fc67 verify the ignored fee is still 0 (#3007)
* verify the ignored bytes are indeed 0

* check for !=0 (rather than >0)
2019-08-29 12:56:21 +01:00
Antioch Peverell 357bc11746 Fix invalid root (#3005)
* use the correct (header) head for the header extension

* add test coverage for header first fork scenario
2019-08-29 10:15:41 +01:00
Antioch Peverell dcd405e263 cleanup deprecation warnings about missing dyn with trait objects (#2997) 2019-08-26 21:17:47 +01:00
Antioch Peverell d06b56cf6d simplify broadcast - send to all connected peers (#2996) 2019-08-22 16:35:31 +01:00
Antioch Peverell 5bf813ee93 improve checking for p2p connection limits (revised) (#2993)
* Add check for p2p connection limits

* Simplify undesirable connection shutdown

* Make inbound and outbound connections more explicit

* Cleanup inbound and outbound connections

* Cleanup an outbound peers check

* Rename healthy_peers_mix to enough_outbound_peers

* be a lot less restrictive when picking some candidate peers to connect to
keep the peer address queue drained but actually attempt a healthy number of connections
as most of these attempts are going to fail due to majority of nodes not being publicly accessible
2019-08-21 19:58:43 +01:00
antiochp 17dddeeb0d Revert "Improve checking for p2p connection limits (#2985)"
This reverts commit 24f0a52437.
2019-08-21 15:02:10 +01:00
j01tz 24f0a52437 Improve checking for p2p connection limits (#2985)
* Add check for p2p connection limits

* Simplify undesirable connection shutdown

* Make inbound and outbound connections more explicit

* Cleanup inbound and outbound connections

* Cleanup an outbound peers check

* Rename healthy_peers_mix to enough_outbound_peers
2019-08-21 12:43:09 +01:00
Mattia Rossi ea023387bf Fix doc grin <subcommand> help syntax. (#2991) 2019-08-20 18:05:26 +01:00
Antioch Peverell 6036b671e8 fee and lock_height maintained in kernel features variants (#2859)
* fee and lock_height now maintained in kernel features enum variants

* sum fees via explicit enum variants

* cleanup semantics around with_fee and with_lock_height for tx builders

* document the kernel feature variants

* serialize kernel features correctly for api json

* cleanup

* commit

* bump to unstick azure
2019-08-19 14:28:02 +01:00
j01tz d220410571 Improve error handling when computing PMMR roots (#2988)
* Improve error handling for invalid PMMR roots

* Update tests that rely on pmmr root

* Fix pmmr store tests
2019-08-09 15:10:54 +01:00
j01tz ea1d14ddb0 Improve validation when processing orphan blocks (#2981) 2019-08-03 09:07:01 +01:00
Yeastplume 705fcbb1a6 Updates to support XORed wallet keys/Tokens (#2982)
* updates to support xored tokens in wallet

* rustfmt
2019-08-02 11:30:26 +01:00
Quentin Le Sceller f79d05ba53 TxHashSet Download Improvement (#2984)
* Ban on cannot get block header in txhashset_write

* Rusfmt

* Fix typo

* Missing error handling

* Rustfmt

* Only accept txhashset from corresponding peer

* Switch to AtomicBool instead of RwLock<bool>

* Rustfmt
2019-08-01 17:46:06 +01:00
Antioch Peverell 4bd3aa109d cleanup and simplify how we generate the genesis block in user_testing (and automated_testing) modes (#2986) 2019-08-01 17:22:12 +01:00
Antioch Peverell aa5c428eb1 Prune list robustness (#2976)
* make prune list deserialization more robust (1-index vs 0 values)

* cleanup
2019-07-29 12:42:12 +01:00
eupn d918c5fe84 extkey_bip32.rs: fix misleading comment on HMAC (#2979) 2019-07-27 17:44:44 +01:00
NaN-git 0d4d98db0d fix wording in comment (#2913) 2019-07-26 08:43:18 +01:00
Antioch Peverell 515fa54614 Rewind head and header_head consistently. (#2918)
* maintain header_head as distinctly separate from head

* cleanup corrupted storage log msg

* simplify process_header and check_header_known

* remember to commit the batch when successfully processing a header...

* rework sync_block_headers for consistency with process_block_header

* cleanup unrelated code

* fix pool tests

* cleanup chain tests

* cleanup chain tests (reuse helpers more)

* cleanup - head not header on an extension
shortcircuit "rewind and apply fork" for headers if next header
2019-07-26 08:36:24 +01:00