Commit graph

2433 commits

Author SHA1 Message Date
mmgen
928097ad62 Increase IO_TIMEOUT to allow nodes on high-latency connections to sync (#3109)
Commit d3dbafa80b "Use blocking IO in P2P to reduce CPU load" (merged
into v2.1.0) introduced the constant IO_TIMEOUT, setting it to 1 second.

On nodes with high-latency connections, this short timeout causes the
txhashset archive download during step 2 of the IBD process to
invariably fail before it completes.  Since there's no mechanism for
resuming a failed download, this means the node gets stuck at this stage
and never syncs.

Increasing IO_TIMEOUT to 10 seconds solves the issue on my node; others
might suggest a more optimal value for the constant.
2019-11-13 21:12:38 +01:00
hashmap
76ac9419b8
Remove error serialization/deserialization (#3110)
it's not used
2019-11-13 21:08:20 +01:00
Joseph Goulden
8ce2bfda58 feat: TUI logs view (#3064)
* fix: add logs page to TUI

* chore: print panic traces to TUI logs

* chore: stop and start tui nicely and a bit of refactoring

* chore: rustfmt

* chore: typo

* chore: use sync_channel for logs

* chore: don't try to unwrap err on try_send log message

* chore: fix compiler/lint warnings

* fix: Only create logs channel if TUI is enabled and resovle other small review comments

* fix: wrap logs in TUI to fix window size

* fix: debug and trace logs appear white in the TUI logs
2019-11-13 09:45:59 -05:00
Yeastplume
38e6497919
Retrieve outputs within a block height range (#3103)
* add function to retrieve a set of pmmr indices between a given block height range

* typo

* change APU to just return required indices

* change pmmr index retrieval, change new function to only return pmmr indices between blocks
2019-11-04 15:04:21 +00:00
Antioch Peverell
50ce7ba043
Refactor transaction building combinators (#3057)
* tx combinators now take operate on Result to allow for more robust errors handling
replace with_fee() and with_lock_height() with a more flexible with_features()

* pass kernel features in as arg to build::transaction()

* fix chain tests

* fix pool tests

* do not pass kernel around in the combinators
just set it once on the tx when building

* build::partial_transaction now takes a existing tx to build on
2019-11-01 10:56:58 +00:00
Shannon
eadf66339d fix a spelling mistake (#3106) 2019-10-31 19:04:54 +01:00
Antioch Peverell
a362888ab9
read header_head and sync_head from the header and sync MMR respectively (#3045)
no need to maintain header_head and sync_head in the db explicitly
2019-10-29 16:47:08 +00:00
Xavier Lau
a39ff54a7f optimize: avoid insert into Vec; use into_iter for less dereference (#3102) 2019-10-29 14:35:59 +00:00
Joseph Goulden
67057ab36d fix: add shutting down dialog to TUI (#3101)
* fix: add shutting down dialog to the TUI
2019-10-28 13:28:36 +01:00
hashmap
1f5de6beb9
Verify headers and blocks only when needed (#3023)
* Verify headers and blocks only when needed

Curretnly we have some lightweigt validation implemented as part of
entity deserialization, which is safer and allows us to not parse the
entire object if some part is invalid. At the same time this logic
always applies when we read an entity, eg when reading from DB.

This PR introduces UntrustedHeader/Block which is used when we read from
the network. It does partial validation during read, then it is supposed
to be converted into regular header/block which doesn't validate itself.

Also this PR adds "lightweight" validation to block header read like we have
for block body, so we don't parse block body if the header is invalid.

Fixes #1642

* Move version validation to untrusted header

* update fuzz tests
2019-10-27 08:40:52 +01:00
hashmap
8a7da89d47 Remove usage of try! macro, use ? instead (#3097)
We converted the major part of the code a while ago, but some occurences were left. It's a compiler warning on nightly already.
2019-10-21 15:01:18 -04:00
Xavier Lau
b4e42bef8d mmr simplified Chinese translation (#3095) 2019-10-17 09:17:32 -04:00
hirogasa
9bb14b4864 [DOC] Update japanese translation (#3020)
* Fix typo

* Fix markdown

* Update translation

* "MimbleWimble" -> "Mimblewimble"
2019-10-16 11:04:42 -04:00
Antioch Peverell
da2e752991
skip hydrate if missing kernels, just request full block (#3090) 2019-10-10 16:46:00 +01:00
Antioch Peverell
8f4a1cba67
track opts when requesting blocks (not just if we requested them) (#3089) 2019-10-10 09:38:25 +01:00
j01tz
67b2ff717b Implement security-process RFC (#3009)
* Implement security-process RFC

* Update canary, disclosure contacts

* Fix typo

* Use grin-security links instead
2019-10-08 18:26:24 +03:00
Antioch Peverell
39016faf52
use remove_range_closed for clarity (#3088) 2019-10-07 21:01:44 +01:00
Joseph Goulden
94b351beac chore: pre-commit hook - format all staged files, re-add then commit (#3078)
* chore: pre-commit hook - format all staged files, re-add then commit

* chore: pre-commit hook - formatted files logged green colour
2019-10-07 21:00:41 +01:00
Antioch Peverell
a3f3fc25dc
use sender thread consistently to send msgs to a peer (#3067) 2019-10-07 16:22:05 +01:00
Antioch Peverell
95e74c7b4b
quick check for block_exists in adapters (#3068) 2019-10-07 09:08:55 +01:00
Quentin Le Sceller
eefd87aa2e
More robust peer banning (#3086)
More robust peer banning
2019-10-04 18:00:49 -04:00
Yeastplume
4e37c1c9e7
Update Serde annotations in pool crate (#3081)
* update serde annotations in pool crate

* rustfmt
2019-10-04 11:44:46 +01:00
Yeastplume
24cf75cead
update versioning to 3.0.0 alpha (#3080) 2019-10-04 10:51:55 +01:00
Antioch Peverell
b78ace8329
bump version to v2.1.0-beta.3 (#3075) 2019-10-03 10:36:54 +01:00
Yeastplume
773961b6c1
Serde serialization for Option<Commitment> (#3074)
* add Option<Commit> serialization

* rustfmt
2019-10-03 10:27:25 +01:00
hashmap
62d865c479
Support protocol version 1 and 2 in fuzz targets (#3073) 2019-10-03 09:08:40 +02:00
hashmap
7861a40384
Fix reading POW for edge bits 59 and higher (#3069)
* Fix reading POW for edge bits 59 and higher

It requires reading more than 8 bytes
2019-10-02 11:52:10 +02:00
Quentin Le Sceller
2ee8d06d48 Remove deprecated v1 wallet owner api documentation (#3071)
* Remove deprecated v1 wallet owner api documentation

* Fix typo
2019-10-02 09:40:56 +01:00
Quentin Le Sceller
6be6391225 Change 2018 to 2019 in copyright files (#3072) 2019-10-02 09:40:20 +01:00
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