Commit graph

2498 commits

Author SHA1 Message Date
Antioch Peverell
824c51a346
bump version to 4.1.0 on master (4.0.1 on 4.0.x branch) (#3390) 2020-07-13 12:16:43 +01:00
Antioch Peverell
84ad59c5be
more robust handling of min_height and max_height in get_kernel_height() (#3387)
* more robust handling of min_height and max_height in get_kernel_height()

* cleanup
2020-07-13 11:31:52 +01:00
Antioch Peverell
32253194b5
log reorg (and fork) depth correctly (#3376)
* log reorg (and fork) depth correctly
depth should be based on "fork point" not prev head

* correct depth for fork/reorg (0 for alternate head etc.)
2020-07-08 09:02:28 +01:00
Antioch Peverell
30db9c410e
bump master to 4.0.1-alpha.1 to differentiate from 4.0.0 official tagged build (#3374) 2020-07-02 15:51:11 +01:00
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
John Tromp
238522a9fb
add CuckooParams::node_mask, obsolete EdgeType and sipnode shift arg (#3365) 2020-06-26 12:13:25 +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
20b4500625
make sure header PMMR is init correctly based on header_head from db (#3362)
* make sure header PMMR is init correctly based on header_head from db

* fix to ensure header PMMR is consistent with header_head in db on chain init

* change order of operations - validate header earlier
and avoid applying header to header PMMR before validation
as this potentially leaves the PMMR in a tricky state to rewind from
2020-06-22 10:04:09 -04:00
Antioch Peverell
d3598e25eb
credit where credit is due (#3356) 2020-06-16 18:41:09 +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
Quentin Le Sceller
0cb1a352d3
Remove wallet from CLI (#3347) 2020-06-12 08:39:53 -04:00
Quentin Le Sceller
2fe21c5ceb
Cargo update (#3350) 2020-06-11 10:01:24 -04:00
Antioch Peverell
ce141bee29
chain stats should use head.hash() (#3348) 2020-06-10 22:41:50 +01:00
Antioch Peverell
2223d9f7d7
migrate to V2 Cargo.lock format (#3346)
* migrate to V2 Cargo.lock format

* arrays on multiple lines
2020-06-10 22:21:38 +01:00
Antioch Peverell
6757a3040d
this test was jamming up in azure CI (#3349)
* this test was jamming up in azure CI

* peer handshake test requires global chain type
2020-06-10 21:56:28 +01:00
Quentin Le Sceller
e7f04240fb
Fix compiler warnig (#3345) 2020-06-10 12:41:44 -04: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
Antioch Peverell
b98e5e06a6
fix race condition (#3344) 2020-06-10 13:56:33 +01:00
Quentin Le Sceller
093c500fed
Cargo Update (#3338) 2020-06-08 17:15:32 -04:00
John Tromp
e28e02ecd4
simplify by avoiding unnecessary conversions (#3343) 2020-06-08 17:04:06 -04:00
Boqin Qin
992d450e0a
servers, util: fix deadlock caused by conflicting lock order (#3340) 2020-06-08 16:59:17 -04:00
Antioch Peverell
c54568e69f
Rework pool tests to use real chain (was mock chain) (#3342)
* rework pool tests to use real chain (was mock chain) to better reflect reality (tx/block validation rules etc.)

* cleanup
2020-06-07 09:26:08 +01:00
Yeastplume
c7c9a32b9b
4.0.0-beta.1 Version Bump (#3339) 2020-06-04 14:52:26 +01:00
John Tromp
f4295917a0
header version 4 accompanied by new AR PoW (#3334) 2020-06-04 09:05:56 -04:00
Boqin Qin
450d235358
servers: fix possible deadlock (#3337) 2020-06-03 13:34:44 +02:00
Antioch Peverell
e7d2c71ca6
display chain type on tui title bar (#3336) 2020-05-29 09:18:00 -04:00
Antioch Peverell
5b825fbf0d
check_known now takes total_difficulty into consideration (#3298)
* check_known now takes total_difficulty into consideration

* update based on feedback
2020-05-29 10:21:12 +01:00
Antioch Peverell
988a05f023
Enable NRD kernel support (noop) feature flagged (#3303)
* wip

* commit

* add block level validation rule around NRD kernels and HF3 block height

* wip

* test coverage for kernel ser/deser for NRD kernels

* add some type safety around ser/deser of nrd relative height

* cleanup

* cleanup tx sig handling and add tests around NRD kernel sig

* test coverage for chain apply block containing NRD kernel

* verify kernel variants when adding tx to pool
NRD kernels will not be accepted until HF3

* add txpool test for NRD kernel handling

* fix merge

* fix api for NRD kernels

* commit

* wip - feature flag for NRD kernel support

* wip

* global config and thread local feature flag for NRD kernel support

* add feature flag support for NRD kernels
default to false when starting up node
allow it to be set to true in context of individual tests

* feature flag

* explicit testing of NRD kernel via feature flag

* add chain_type and feature flag logging on startup

* PR feedback and cleanup

* PR feedback
2020-05-29 09:56:24 +01:00
hashmap
731528c616
Some optimizsations in TUI (#3325)
* Do not allocate String for static status, use Cow instead, eg we allocate "Running" string at every refresh
* Use static dispatch for Views instead of Box<dyn View>
* Update only the current view
* Simplify Listener trait
2020-05-29 09:55:07 +01:00
Antioch Peverell
a8b8dc3a7f
add test to demonstrate pair of "half" kernels sharing same public excess (#3314)
* cleanup how we handle key splitting for transaction offset
add test to demonstrate a pair of transaction halves sharing same kernel excess

* cleanup

* cleanup
2020-05-28 15:26:18 +01:00
Antioch Peverell
b570ac9925
ignore .vscode (#3333) 2020-05-24 23:34:33 +02: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
David Burkett
096b6924ce
Adding kernel_mmr_size and output_mmr_size to BlockHeaderPrintable (#3329) 2020-05-22 10:10:14 +01:00
Quentin Le Sceller
d2d3e4c547
Remove compiler warning (#3331) 2020-05-21 13:08:01 -04:00
Quentin Le Sceller
5d0791bbd1
Add servers (#3315) 2020-05-21 13:07:28 -04:00
David Burkett
952bdcc4c8
Fixing doc (#3330) 2020-05-19 13:25:41 -04:00
Quentin Le Sceller
28644a63cf
Fix miminum share difficulty in Stratum Server (#3323) 2020-05-19 11:07:33 -04:00
hashmap
93f5de3d29
Introduce a pause after calling Cursive.step (#3326)
Currently we call it in a loop without any delays which burns cpu cycles for little value.
On my machine I see decrease of cpu usage from 12% to 6% on a synced node after applying this fix.
2020-05-16 17:12:45 +02:00
Antioch Peverell
133a8da53e
Refactor bucket_transactions() and evict_transaction() (#3319) 2020-05-14 14:21:41 -04:00
hashmap
2c62111561
Remove some unwraps in LMDB client (#3313) 2020-05-13 16:18:55 +02:00
Quentin Le Sceller
e826cd82f9
Update (#3324) 2020-05-12 11:48:18 -04: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
Antioch Peverell
c82199bb97
cleanup weird egde_bits handling in tests (#3316) 2020-05-04 12:40:16 +01: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
hashmap
9e51e86538
Use generic types instead of trait objects in tx pool (#3308)
Tx pool takes some parameters as trait objects. It's not an idiomatic Rust code, in this particular case we should use generic types. Trait object makes sense when we accept in runtime different concrete types which implement the trait as a value of the same field. It's not the case here. Trait objects come with a price - instead of method dispatch in compile time we have to accept runtime dispatch. My guess we did it to not clutter the code with type parameters, which is understandable but still suboptimal.
2020-04-30 17:41:49 +02:00
Quentin Le Sceller
061bf3d08f
Add depreciation warning (#3310) 2020-04-28 12:17:34 -04:00