Update Serde annotations in pool crate (#3081)
* update serde annotations in pool crate * rustfmt
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
[DOC] Update japanese translation (#3020)
* Fix typo * Fix markdown * Update translation * "MimbleWimble" -> "Mimblewimble"
Remove usage of try! macro, use ? instead (#3097)
We converted the major part of the code a while ago, but some occurences were left. It's a compiler warning on nightly already.
Verify headers and blocks only when needed (#3023)
* Verify headers and blocks only when needed Curretnly we have some lightweigt validation implemented as part of entity deserialization, which is safer and allows us to not parse the entire object if some part is invalid. At the same time this logic always applies when we read an entity, eg when reading from DB. This PR introduces UntrustedHeader/Block which is used when we read from the network. It does partial validation during read, then it is supposed to be converted into regular header/block which doesn't validate itself. Also this PR adds "lightweight" validation to block header read like we have for block body, so we don't parse block body if the header is invalid. Fixes #1642 * Move version validation to untrusted header * update fuzz tests
fix: add shutting down dialog to TUI (#3101)
* fix: add shutting down dialog to the TUI
read header_head and sync_head from the header and sync MMR respectiv…
…ely (#3045) no need to maintain header_head and sync_head in the db explicitly
Refactor transaction building combinators (#3057)
* tx combinators now take operate on Result to allow for more robust errors handling replace with_fee() and with_lock_height() with a more flexible with_features() * pass kernel features in as arg to build::transaction() * fix chain tests * fix pool tests * do not pass kernel around in the combinators just set it once on the tx when building * build::partial_transaction now takes a existing tx to build on
Retrieve outputs within a block height range (#3103)
* add function to retrieve a set of pmmr indices between a given block height range * typo * change APU to just return required indices * change pmmr index retrieval, change new function to only return pmmr indices between blocks
* fix: add logs page to TUI * chore: print panic traces to TUI logs * chore: stop and start tui nicely and a bit of refactoring * chore: rustfmt * chore: typo * chore: use sync_channel for logs * chore: don't try to unwrap err on try_send log message * chore: fix compiler/lint warnings * fix: Only create logs channel if TUI is enabled and resovle other small review comments * fix: wrap logs in TUI to fix window size * fix: debug and trace logs appear white in the TUI logs
Increase IO_TIMEOUT to allow nodes on high-latency connections to sync (
#3109) Commit d3dbafa "Use blocking IO in P2P to reduce CPU load" (merged into v2.1.0) introduced the constant IO_TIMEOUT, setting it to 1 second. On nodes with high-latency connections, this short timeout causes the txhashset archive download during step 2 of the IBD process to invariably fail before it completes. Since there's no mechanism for resuming a failed download, this means the node gets stuck at this stage and never syncs. Increasing IO_TIMEOUT to 10 seconds solves the issue on my node; others might suggest a more optimal value for the constant.
Make imports in core crate more Rust 2018 idiomatic (#3112)
We use crate renaming to remove grin prefix, as result imports for util and keychain crates start with crate:: which looks like a part of the current crate. This PR fixes it. Also some small improvements were made. If this approach works I'll replicate it to other crates.
[doc]Chinese Translation: grin4bitcoiners_ZH-CN.md (#3116)
* Create grin4bitcoiners_ZH-CN * Rename grin4bitcoiners_ZH-CN to grin4bitcoiners_ZH-CN.md
add tx pool kernel counts to tui status page (#3111)
* add tx pool kernel counts to tui status page * fix formatting on tui
fix: for TUI status try to acquire read lock on pmmr_header but if no… (
#3119) fix: for TUI status try to acquire read lock on pmmr_header but if not available just leave the header stats alone
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
Replace MimbleWimble by Mimblewimble (#3118)
* Replace MimbleWimble by Mimblewimble * MimbleWimble->Mimblewimble
use try_read_for() with timeout for tui status updates (header and po…
…ol stats) (#3129) * use try_read_for with timeout for tui status updates (header and pool stats) * rework based on feedback
* add: simplified Chinese translation
Fixing misleading privacy claim (#3127)
* Correcting an old, misleading claim * Merge conflict * Changing "confidential transactions" to "hidden amounts"
* 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
Captute "type" byte for unknow message type (#3146)
Found it useful for debugging
Set longer timeout for msg body read/write operations (#3145)
* Set longer timeout for msg body read operations * Introduce a channel timeout
cleanup HeaderVersion::default() (#3149)
* header version now explicit, no "default" version "empty" block can safely have verion 0 as it needs to be set later * default block header uses version 1 * HeaderVersion(1)
height (header version) specific output PMMR root rules (#3147)
* height (header version) specific output PMMR root rules * cleanup * cleanup based on PR feedback * address feedback