* 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
* 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
* 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
* 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>
* 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
* 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
* 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
* 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>
* 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
* 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