Commit graph

2208 commits

Author SHA1 Message Date
Antioch Peverell
3a333ae00f
deadlock risk in check_orphans called from txhashset_write (#3156) 2019-12-05 10:32:01 +00:00
Antioch Peverell
52ea906b61
cleanup HeaderVersion::default() (#3149)
* header version now explicit, no "default" version
"empty" block can safely have verion 0 as it needs to be set later

* default block header uses version 1

* HeaderVersion(1)
2019-12-02 12:35:17 +00:00
hashmap
cbc17ff5f7 Set longer timeout for msg body read/write operations (#3145)
* Set longer timeout for msg body read operations

* Introduce a channel timeout
2019-12-02 12:00:30 +00:00
Antioch Peverell
7f7d51a748 our TCP listener is nonblocking so we *must* set the accepted stream to blocking explicitly... (#3154) 2019-12-01 00:56:23 +01:00
Antioch Peverell
c46343f279
cleanup HeaderVersion, "newtype" no need for constructor (#3150) 2019-11-30 23:14:35 +00:00
Antioch Peverell
869cfd2b82
explicit header version based on height rather than "increment" the version (#3148) 2019-11-29 14:32:39 +00:00
hashmap
ba9cdd323e Revert "Remove error serialization/deserialization (#3110)" (#3151)
This reverts commit 76ac9419b8.
2019-11-29 12:37:50 +00:00
hashmap
3f528a8e66
Captute "type" byte for unknow message type (#3146)
Found it useful for debugging
2019-11-29 13:04:55 +01:00
John Tromp
82b1ff905d Hardfork2 (#3136)
* add 2nd HF and cuckaroom

* add cuckaroom and hardfork tests

* remove all traces of later phaseouts

* refactor header_version from valid_header_version
2019-11-27 20:36:36 +00:00
Antioch Peverell
e2795b1593
call zip_read fro within the txhashet lock for a consistent view on the files (#3142) 2019-11-26 21:17:28 +00:00
Antioch Peverell
11ac7d827a
Enable faster sync (#3108)
* add bitmap accumulator
refactor vec backend so we can use it outside of tests
introduce a "hash only" vec backend for the accumulator

* get core tests passing

* initial test coverage for bitmap_accumulator

* better test coverage for bitmap accumulator and cleanup code

* refactor txhashset roots, call validate() on roots during block validation

* fix store tests

* log the "merged" root when validating roots

* cleanup, revise based on feedback

* cleanup

* rework it to pass explicit size into bitmap accumulator when applying
2019-11-26 20:21:49 +00:00
David Burkett
41896f0ec2 Fixing misleading privacy claim (#3127)
* Correcting an old, misleading claim

* Merge conflict

* Changing "confidential transactions" to "hidden amounts"
2019-11-26 20:17:16 +00:00
Antioch Peverell
dcfcd3ee79
use saturatig_sub() to avoid a negative value causing an overflow panic (#3139) 2019-11-26 19:05:04 +00:00
Xavier Lau
0c6c464e94 Chinese translation (#3098)
* add: simplified Chinese translation
2019-11-26 14:57:01 +01:00
Lars-Magnus Skog
f07a897e33 docs: grin wallet was lifted out in v1.1.0 (#3123) 2019-11-26 14:51:47 +01:00
Antioch Peverell
78220febed
use try_read_for() with timeout for tui status updates (header and pool stats) (#3129)
* use try_read_for with timeout for tui status updates (header and pool stats)

* rework based on feedback
2019-11-22 12:46:07 +00:00
Antioch Peverell
32609fc542
mismatch between the test dir used and the test dir cleaned up... (#3133) 2019-11-22 11:17:00 +00:00
Quentin Le Sceller
04e7d307ce Replace MimbleWimble by Mimblewimble (#3118)
* Replace MimbleWimble by Mimblewimble

* MimbleWimble->Mimblewimble
2019-11-19 10:49:32 +00:00
Joseph Goulden
8fde3b3829 fix: #3117 For backwards compatibility only capitalise first letter o… (#3124)
* fix: #3117 For backwards compatibility only capitalise first letter of log level in config file

* fix: For forwards compatibility old config needs Warning log level changed to standard log::Level WARN

* refactor: renamed some variables
2019-11-18 15:44:25 +00:00
Joseph Goulden
6d864a813c fix: split state validation status into kernel and rproof updates. (#3096)
* fix: split state validation status into kernel and rproof updates. And fix sync status for these two states

* fix: show correct number of leaves for pruned MMR as well as unpruned

* docs: better docs for kernel/range proof validation

* fix: ordering of kernel and rproofs validation in TUI

* fix: typo in rangeproofs api and comments
2019-11-17 22:12:10 +01:00
Quentin Le Sceller
739a190352
Remove grin-tech from DNS seeds (#3121) 2019-11-17 13:00:10 -05:00
Joseph Goulden
29b871841a fix: for TUI status try to acquire read lock on pmmr_header but if no… (#3119)
fix: for TUI status try to acquire read lock on pmmr_header but if not available just leave the header stats alone
2019-11-15 08:21:42 +01:00
Antioch Peverell
8d2c43d7e8
add tx pool kernel counts to tui status page (#3111)
* add tx pool kernel counts to tui status page

* fix formatting on tui
2019-11-14 16:21:27 +00:00
Leo Young
a1061f09a8 [doc]Chinese Translation: grin4bitcoiners_ZH-CN.md (#3116)
* Create grin4bitcoiners_ZH-CN

* Rename grin4bitcoiners_ZH-CN to grin4bitcoiners_ZH-CN.md
2019-11-14 10:34:44 -05:00
hashmap
43bd5a56ff Make imports in core crate more Rust 2018 idiomatic (#3112)
We use crate renaming to remove grin prefix, as  result imports for util and keychain crates start with crate::
which looks like a part of the current crate. This PR fixes it.
Also some small improvements were made.
If this approach works I'll replicate it to other crates.
2019-11-14 10:27:30 -05:00
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