Commit graph

2496 commits

Author SHA1 Message Date
yeastplume
145d819445 update Cargo.lock for next release 2022-03-22 14:15:51 +00:00
Yeastplume
78c9794d30
TUI Freeze Fix - Add manually maintained hash to difficulty iterator (#3684)
* add manually managed hash to difficulty iterator

* text fix

* fix for hash-of-hash, review feedback
2022-01-07 14:23:58 +00:00
deevope
a3eebbc0ab
verify-chain node client arg (#3678)
* add parameter fast_validation to the api

* arg `verify-chain` on node client

* arg verify chain + read_timeout parameter

* change timeout to 2hours

* update with tromp review

* 2nd comment from tromp
2022-01-07 13:45:48 +00:00
deevope
c92d2e9fba
graceful api shutdown (#3677) 2022-01-07 13:24:54 +00:00
Yeastplume
2237f42144
Handle attempts to get block headers at invalid heights (#3683)
* handle attempts to get block headers at invalid heights

* compare requested height against header pmmr size

* gte
2021-12-31 09:47:04 +00:00
deevope
382e914c50
make fn rewind_hash pub (#3674) 2021-12-13 12:18:37 +00:00
Yeastplume
63c65605bb
[SYNC PERFORMANCE] Adjust DifficultyIterator to no longer deserialize PoW proof nonces (#3671)
* replace bitvec with more efficient bitpack algorithm

* optimise proof_unpack_len

* move proof pack length calculation

* small refactor

* first pass attempt at not deserializing proof nonces in difficulty iter

* another 10 seconds gained by not deserialising the proof from the difficulty iterator

* add new deser parameters to tests where needed

* add skip_proof variants to store

* remove hash from difficulty iterator struct, rename HeaderInfo to HeaderDifficultyInfo

* replace bitvec with more efficient bitpack algorithm

* optimise proof_unpack_len

* move proof pack length calculation

* small refactor

* first pass attempt at not deserializing proof nonces in difficulty iter

* another 10 seconds gained by not deserialising the proof from the difficulty iterator

* add new deser parameters to tests where needed

* add skip_proof variants to store

* remove hash from difficulty iterator struct, rename HeaderInfo to HeaderDifficultyInfo
2021-12-10 11:39:39 +00:00
Yeastplume
7725a05ac1
[SYNC PERFORMANCE] Replace header proof serialisation with more efficient algorithm (#3670)
* replace bitvec with more efficient bitpack algorithm

* optimise proof_unpack_len

* move proof pack length calculation

* small refactor

* integrate suggestions in #3670

* finish compressing compression function

* remove ordering cmp from pack function

* remainder fix for new logic

* remove println statements

* remove ordering import warning
2021-12-06 16:35:23 +00:00
John Tromp
c6f25e9929
Spdupverifypow (#3672)
* speed up cuckatoo verify

* speed up cuckaroo verify

* speed up cuckarood verify

* speed up cuckaroom verify

* speed up cuckarooz verify
2021-12-06 12:22:44 +00:00
Yeastplume
2f5cfbe4eb
[PIBD] PMMR Desegmenter Structure (Pt. 1) (#3667)
* initial commit of WIP pibd explorations

* correct calling for obtaining and validating first segment

* update test to properly iterate through each segment of the test pmmrs, validating each segment as it goes

* updated test to fully segment and validate PMMRs from compacted and uncompacted sample data. Also contains method of running test againt live chain data

* remove logger change

* change test file name

* change test file name

* change directory reference in test for CI

* add initial (experimental) structure for PIBD desegmenting

* move bitmap desegmentation logic into desegmenter

* added txhashset methods to apply pibd segments (note this only works for fully unpruned trees atm)

* change last_pos to mmr_size

* fix to pmmr::peaks call

* don't verify POW when copying headers

* prepare for commit of work thus far'

* update test paths

* few updates based on early review
2021-12-02 10:43:38 +00:00
John Tromp
53414ae105
Fixmmr part2 (#3666)
* use 0-based positions in  methods pmmr_leaf_to_insertion_index and bintree_postorder_height; add round_up_to_leaf_pos method

* use 0-based positions in method insertion_to_pmmr_index

* use 0-based positions in method is_leaf

* use 0-based positions in method family()

* use 0-based positions in method is_left_sibling

* use 0-based positions in method family_branch

* use 0-based positions in methods bintree_{left,right}most

* use 0-based positions in method bintree_pos_iter

* use 0-based positions in method bintree_range

* use 0-based positions in method bintree_leaf_pos_iter

* rename last_pos in MMR related structs to size

* use 0-based positions in method prune

* use 0-based positions in method push and apply_output return value

* use 0-based position argument of method merkle_proof

* use 0-based outputs in method pmmr::peaks

* fix peaks() code comments

* refix peaks() code comments

* use 0-based positions in method get_peak_from_file

* use 0-based positions in methods get_data_from_file

* use 0-based positions in methods get_from_file

* use 0-based positions in methods get_data

* use 0-based positions in methods get_hash

* use 0-based positions in method peak_path

* use 0-based positions in method bag_the_rhs

* use 0-based positions in method Backend::remove

* use 0-based positions in method leaf_pos_iter

* use 0-based positions in method self.LeafSet::includes

* use 0-based positions in methods self.LeafSet::{add,remove}

* use 0-based positions in methods is_pruned,is_pruned_root,is_compacted

* use 0-based positions in methods PruneList::append

* use 0-based positions in methods append_pruned_subtree

* use 0-based positions in method calculate_next_leaf_shift

* use 0-based positions in method append_single

* use 0-based positions in method calculate_next_shift

* use 0-based positions in method segment_pos_range

* use 0-based positions in method reconstruct_root

* use 0-based positions in method validate_with

* use 0-based positions in method validate

* rename size (formerly last_pos) to mmr_size

* use 0-based positions in Segment's hash_pos and leaf_pos

* minimize use of saturating_sub(1) and rename some pos/idx to size

* use 0-based positions in methods get_output_pos

* use 0-based positions in method get_unspent_output_at

* use 0-based positions in method get_header_hash

* use 0-based positions in methods MerkleProof::verify{,_consume}

* use 0-based positions in method cleanup_subtree

* don't allow 0 in prunelist bitmap

* use 0-based positions in methods get_{,leaf_}shift

* rename some 1-based pos to pos1; identify TODO

* Address yeastplume's PR review comments
2021-11-26 11:25:10 +00:00
Yeastplume
c8275f7e57
[PIBD] Chain Segmenter Validation Test + Block Archive Horizon Change (#3665)
* initial commit of WIP pibd explorations

* correct calling for obtaining and validating first segment

* update test to properly iterate through each segment of the test pmmrs, validating each segment as it goes

* updated test to fully segment and validate PMMRs from compacted and uncompacted sample data. Also contains method of running test againt live chain data

* remove logger change

* change test file name

* change test file name

* change directory reference in test for CI

* remove +1 from segment count

* prediction comment change

* add ignore of full-chain test
2021-11-23 12:38:52 +00:00
John Tromp
4aaa3344e6
refactor pmmr functions, improve efficiency; panic on 0 pos1 (#3663) 2021-11-12 11:11:50 +00:00
Yeastplume
3f4f165e0b
PMMR Backend Support for append_pruned_root (Continued) (#3659)
* refactor prune_list with aim of allowing pruned subtree appending

* add test coverage around pmmr::is_leaf() and pmmr::bintree_leaf_pos_iter()

* comments

* cleanup

* implement append pruned subtree for prune_list

* commit

* we can now append to prune_list

* fix our prune_list corruption...

* rework how we rewrite the prune list during compaction

* test coverage for improved prune list api

* continuing to merge

* finish merge, tests passing again

* add function pmmr_leaf_to_insertion_index, and modify bintree_lef_pos_iter to use it. Note there's still an unwrap that needs to be dealt with sanely

* change pmmr_leaf_to_insertion_index to simpler version + handle conversion between 1 and 0 based in bintree_leaf_pos_iter

Co-authored-by: antiochp <30642645+antiochp@users.noreply.github.com>
2021-11-09 15:34:10 +00:00
Quentin Le Sceller
3ae4c75569
Update digest, hmac, ripemd160, sha2 and pbkdf2 crates (#3655) 2021-11-02 15:40:31 +00:00
Yeastplume
0170f03e4a
Rust 2021 Macro Warning Cleanup (#3658)
* small warning cleanup

* remove unused imports in tests
2021-11-02 15:10:01 +00:00
Quentin Le Sceller
2e2149859f
bump to 5.2.0-alpha.1 on master (#3652) 2021-08-19 09:06:52 +02:00
Quentin Le Sceller
1cb222786a
Change connection name for CI Release (#3653) 2021-08-18 15:45:52 +02:00
Quentin Le Sceller
11e5efc089
Tagging v5.1.1 release (#3651) 2021-08-17 20:57:13 +02:00
Quentin Le Sceller
172143f7ea
Fix ROARING_ARCH environment variable (#3644) 2021-06-10 09:42:04 -04:00
Alesio Kanani
4155555f80
Spelling Improvements (#3642)
* Spelling Improvement
2021-05-13 14:07:14 -04:00
John Tromp
f51b6e1376
implement fix past fees RFC with fee shift since genesis (#3629) 2021-05-11 16:39:09 +01:00
Antioch Peverell
a9f1dd7bcd
bump to 5.2.0-alpha.1 on master (#3640) 2021-05-06 13:46:03 +01:00
Antioch Peverell
72a6eb81e8
bump to 5.1.0 to prep for release (#3639) 2021-05-06 13:02:01 +01:00
Antioch Peverell
87729a2227
bump crate version to 5.1.0-beta.2 to prep for release (#3636) 2021-04-29 13:05:28 +01:00
Antioch Peverell
89c06ddab7
client invalidateheader and resetchainhead (#3618)
* wip - "reset_head" via owner api functionality

* jsonrpc pass hash in as a string

* sort of works

* not a reorg if we simply accept several blocks at once

* remember to reset header MMR separately
as it is readonly when interacting with txhashset extension

* basic client integration
needs error handling etc.

* reset sync status when reset chain head

* track "denylist" (todo) and validate headers against this via the ctx

* track denylist (header hashes) in chain itself

* header denylist in play

* expose invalidateheader as client cmd

* rework reset_chain_head - rewind txhashset then header MMR
2021-04-29 11:05:05 +01:00
trevyn
9e27e6f9d3
Add migration to config_file_version = 2 (#3634)
* Add config_file_version and migration to version 2

* Generate `config_file_version = 2` as default
2021-04-27 14:33:56 +01:00
Blade Doyle
9ed0cd65ef
fix share difficulty validation - compare stratum server minimum_share_difficulty as unscaled difficulty (#3624)
* fix for comparing scaled vs unscaled difficulty

fix mix use of scaled and unscaled, add additional comments to clarify which values are which

improved consistency - scaled and unscaled difficulty

* combine from_proof_unscaled() and  to_unscaled_difficulty{}

* code review - rust syntax
2021-04-23 09:28:29 -04:00
GeneFerneau
1b8acee72e
Update zip dependency and fix deprecation warnings (#3617)
Update zip crate to latest version, and fix deprecation warnings
using functionally equivalent APIs
2021-04-13 22:20:21 +01:00
trevyn
f8afdb5faa
Fix Windows CI cargo test silently passing (#3632)
* set env in different way for windows-release.yml
2021-04-07 10:15:34 -04:00
Antioch Peverell
34413c1cab
track sync_head on header_sync sync status (#3626)
* track sync_head on header_sync sync status
follow header fork as appropriate

* track highest_diff alongside highest_height on HeaderSync status

* cleanup

* not not
2021-04-06 11:16:20 +01:00
trevyn
df91bff0f1
Add test for duplicate rangeproof inflation bug (#3630)
* invalid range proof test

* create output with 1 million grin

* Move `output_negative` into `tests/`

So it cannot be called from outside of tests!

* Verify InvalidBlockProof & InvalidRangeProof types

Co-authored-by: Snape 479 <Severus_Snape93@protonmail.com>
2021-04-06 11:06:52 +01:00
Antioch Peverell
f6ec77a592
never speak of the verifier cache again (#3628) 2021-04-01 15:04:53 +01:00
Blade Doyle
cccaf98493
enhance comment describing how a pow is hashed (#3623)
Integrate feedback from Tromp

Some more feedback from Tromp

readability improvement
2021-03-31 14:43:04 -04:00
Antioch Peverell
09c90fc257
cleanup and stop wrapping errors in other/unfit (#3616) 2021-03-30 09:12:48 +01:00
Quentin Le Sceller
25d93c8606
Revert "Allow rest api to shutdown (#3614)" (#3625)
This reverts commit 4a09fed36c.
2021-03-29 14:11:10 -04:00
Quentin Le Sceller
0acf380320
Remove unnecessary trailing semicolom (#3619) 2021-03-29 08:55:33 +01:00
Ivan Sorokin
4a09fed36c
Allow rest api to shutdown (#3614)
Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
2021-03-25 14:29:24 -04:00
Quentin Le Sceller
e8b46f1409
Update ring to v0.16.20 (#3612) 2021-03-23 10:05:47 -04:00
trevyn
431e4b97b7
Defork croaring (#3596)
* Defork croaring

* Attempt to fix Windows CI

* Fix windows-release.yml too

* Use ROARING_ARCH=x86-64-v2
2021-03-22 13:31:43 -04:00
Squirrel
302c8ec928
Make of this what you will but it cargo fmt better (#3572)
* Make of this what you will but it cargo fmt better

* Reduce clippy excitement.
2021-03-22 12:43:23 +00:00
David Burkett
87ff219d37
Removing verifier caches (#3597) 2021-03-18 16:09:59 +00:00
Antioch Peverell
6690b25f05
Enable block archival sync (#3579)
* wip - body sync for full archive

* allow chain compaction during sync

* placeholder for logic to ensure archive nodes sync from archive nodes

* body sync from archival peers

* allow chain compaction during sync

* placeholder for logic to ensure archive nodes sync from archive nodes
2021-03-16 12:04:09 +00:00
Blade Doyle
846b8f82e8
fix for missing increment of stratum stats blocks_found (#3593) 2021-03-11 10:13:15 -05:00
Quentin Le Sceller
0259ed23ea
Update copyright year to 2021 (#3592)
* Update copyright year to 2021
2021-03-10 10:14:48 -05:00
Quentin Le Sceller
725622da7a
Remove imports and cleanups (#3590)
* Remove unused import and if else chain
2021-03-08 11:09:41 -05:00
Quentin Le Sceller
45f74c396d
Remove unused imports (#3589)
* Remove unused imports
2021-03-08 10:36:16 -05:00
Antioch Peverell
35740204a1
no more conversion to support v2 blocks (#3587)
get_block simply returns None if v2 support required
2021-03-06 21:40:20 +00:00
Quentin Le Sceller
e023739658
Update and do not use serve private export (#3585)
* Update serde, serde_derive, syn, failure and failure_derive

* Do not use serde private export
2021-03-06 15:25:26 -05:00
Blade Doyle
059e6ad545
Mining tui updates (#3584)
* add column ordering, set mining workers table to sort the connected workers to the top by default

* add column ordering, set mining workers table to sort the connected workers to the top by default

* Mining TUI fixes and updates
2021-03-04 09:39:14 -05:00