Commit graph

231 commits

Author SHA1 Message Date
Yeastplume
7abe9fcb39
Versioning for 4.0.0 release (#3373) 2020-07-02 10:29:10 +01:00
Yeastplume
098d25e569
Version bump for 4.0.0-rc.1 (#3366) 2020-06-26 13:10:42 +01:00
Nym Seddon
39ca5d1c11
Store: error handling for file errors (#3364)
Use existing error handling plumbing for Store file creation errors

Co-authored-by: Nym Seddon <unseddd@shh.xyz>
2020-06-25 10:20:26 +01:00
Antioch Peverell
55a929e214
cleanup old unused code (#3355) 2020-06-15 15:05:47 +01:00
Antioch Peverell
dd88d28a7a
bump version to 4.0.0-beta.2 (#3351) 2020-06-12 14:08:12 +01:00
Antioch Peverell
20e5c1910b
NRD rules and "recent" kernel pos index (#3302)
* variants for output_pos linked list entries (head/tail/middle/unique)
next and prev and Vec<u8> lmdb keys

* get_pos on enum

* break list and list entries out into separate enums

* track output features in the new output_pos index, so we can determine coinbase maturity

* push entry impl for none and unique

* some test coverage for output_pos_list

* commit

* wip - FooListEntry

* use instance of the index

* linked list of output_pos and commit_pos both now supported

* linked_list

* cleanup and rename

* rename

* peek_pos

* push some, peek some, pop some

* cleanup

* commit pos
cleanup

* split list and entry out into separate db prefixes

* cleanup and add placeholder for pop_back

* pop_pos_back (for popping off the back of the linked list)
test coverage for pop_pos_back

* wip

* placeholder for prune via a trait
pos must always increase in the index

* rewind kernel_pos_idx when calling rewind_single_block

* RewindableListIndex with rewind support.

* test coverage for rewindable list index

* test coverage for rewind back to 0

* rewind past end of list

* add tests for kernel_pos_idx with multiple commits

* commit

* cleanup

* hook NRD relative lock height validation into block processing and tx validation

* cleanup

* set local chain type for kernel_idx tests

* add test coverage for NRD rules in block processing

* NRD test coverage and cleanup

* NRD relative height 1 test

* test coverage for NRD kernels in block processing

* cleanup

* start of test coverage for txpool NRD kernel rules

* wip

* rework pool tests to use real chain (was mock chain) to better reflect reality (tx/block validation rules etc.)

* cleanup

* cleanup pruneable trait for kernel pos index

* add clear() to kernel_pos idx and test coverage

* hook kernel_pos rebuild into node startup, compaction and fast sync

* verify full NRD history on fast sync

* return early if nrd disabled

* fix header sync issue
2020-06-10 16:38:29 +01:00
Quentin Le Sceller
093c500fed
Cargo Update (#3338) 2020-06-08 17:15:32 -04:00
Yeastplume
c7c9a32b9b
4.0.0-beta.1 Version Bump (#3339) 2020-06-04 14:52:26 +01:00
hashmap
26b411e79e
Reduce memory allocations in PMMR (#3328)
We have a pattern in the code - return Vec, turn it into an iterator, filter and collect to another Vec. The idea was to return iterator where possible to avoid allocating intermediate vecs.
2020-05-24 16:50:27 +01:00
Antioch Peverell
6faa0e8d75
thread local chain type vs global chain type (#3327)
* Introduce GLOBAL_CHAIN_TYPE and make CHAIN_TYPE thread_local.
This makes testing more explicit and significantly more robust.

* set_local_chain_type() in tests

* cleanup - weird

* get pool tests working with explicit local chain_type config

* core tests working with explicit local chain_type

* p2p tests working with explicit local chain_type

* store tests working

* cleanup, feedback
2020-05-22 12:51:58 +01:00
hashmap
2c62111561
Remove some unwraps in LMDB client (#3313) 2020-05-13 16:18:55 +02:00
hashmap
2397407dc4
Always return a typed structure from lmdb store (#3312)
We have a method get which returns a Vec, it's used in cases when we can't implement FromLmdbBytes or Readable on a desired type, eg when both traits and type are external for the current crate. This approach requires an extra allocation of a Vec, this PR introduces a method which accepts desirialzer as closure, which allows to desrialize in place without an intermidiate heap allocation.

It's still possible to get a Vec if needed, just pass a Vec constructor to get_with.
2020-05-05 11:00:23 +02:00
hashmap
8a22fb516a
Reduce number of allocations in to_key calls (#3311)
We have to make an extra allocation per db get request because key generation function to_key takes Vec. Taking byte slice (AsRef<[u8]> to be precise) also simplifes the code a bit.
2020-04-30 17:47:44 +02:00
hashmap
a82041d0ed
Refactor Readable trait (#3309)
Currently Writable accepts trait Write as a type parameter but Readable
takes Read as a trait object, which is not symmetrical and also less performant. This PR changes Readable trait and all places where it's used
2020-04-30 17:42:19 +02:00
jaspervdm
2fe0869321
Use croaring-mw with 'compat' feature (#3274) 2020-03-23 21:12:58 +01:00
Yeastplume
ee5fe1ac63
Use smaller LMDB Allocation Size in non-production modes (#3264)
* add option to override lmdb allocation size in testing

* simplify to use global::is_production_mode
2020-03-10 09:30:12 +00:00
Yeastplume
31bd2d923a
Add better LMDB error output (#3263) 2020-03-09 14:04:06 +01:00
Yeastplume
b73fc0bb9b
Version bump for next development release 2020-03-02 12:27:16 +00:00
Yeastplume
533da2d192
version bump for 3.1.0 release (#3258) 2020-03-02 10:38:56 +00:00
Antioch Peverell
ef755a5c49
bump to 3.1.0-beta.3 (#3252) 2020-02-28 12:42:08 +00:00
Antioch Peverell
5071084445
bump version to 3.1.0-beta.2 (#3244) 2020-02-27 09:35:44 +00:00
Quentin Le Sceller
ef853ae469
Update croaring (#3233) 2020-02-21 15:24:48 +00:00
Quentin Le Sceller
04a0123752
Less cloning and additional pattern simplifications (#3223)
* API Cleanup

* Chain Cleanup

* Core Cleanup

* Keychain Cleanup

* P2P Cleanup

* Pool Cleanup

* Store Cleanup

* Util Cleanup

* Cleanup clone_from_slice

* Address jasper comments
2020-02-12 19:35:33 +01:00
François Garillot
dcdbdd4bcc
Some simple Option / Result / iterator pattern simplifications (#3205) 2020-01-29 14:20:57 +00:00
Antioch Peverell
616dad43fd
Cleanup redundant AsFixedBytes and FixedLength traits (#3131)
* no need for AsFixedBytes we can just use AsRef<[u8]>

* cleanup FixedLength trait

* revert this change for now

* fix store tests

* cleanup and fix tests after rebase

* fix tests

* update based on PR review
less hard-coded values now

* cleanup
2020-01-29 13:41:50 +00:00
Quentin Le Sceller
6e5afe496b Update License to 2020 (#3196) 2020-01-20 11:40:58 +00:00
hashmap
c2026bd686
Remove unused crates (#3185)
* Remove unused crates

also bump minor versions in Cargo.lock
2020-01-15 11:34:14 +01:00
Quentin Le Sceller
d31427f694 Fix compiler warning 'unnecessary parentheses around type' (#3175) 2020-01-06 09:53:49 +00:00
Yeastplume
2bf4080866
versioning for master 2019-12-20 11:13:39 +00:00
Yeastplume
266af4e91f
version bump for master 2019-12-20 11:07:58 +00:00
Yeastplume
a50200799b
version bump (#3174) 2019-12-19 16:24:02 +00:00
Yeastplume
2f8a1f2712
Versioning for 3.0.0-beta.2 (#3170)
* versioning for beta build

* Cargo.lock
2019-12-12 20:37:50 +00:00
Yeastplume
6a54334576
Version bump for beta.1 (#3159) 2019-12-06 12:01:53 +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
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
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
Antioch Peverell
39016faf52
use remove_range_closed for clarity (#3088) 2019-10-07 21:01:44 +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
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
ae556a8a2a
change release versioning for 2.1.0 beta build (#3056) 2019-09-24 13:54:12 +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
Antioch Peverell
f3baceb51b
bump version for 2.1.0 dev (still on master) (#3050) 2019-09-19 15:03:44 +01: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
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
dcd405e263
cleanup deprecation warnings about missing dyn with trait objects (#2997) 2019-08-26 21:17:47 +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
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