Commit graph

2468 commits

Author SHA1 Message Date
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
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