* 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
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.
Commit d3dbafa80b "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.
* 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
* 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
* 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
* 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 some more stats to basic status page of TUI (disk usage, chain timestamp, tx pool size)
* chore: add latest header timestamp to TUI
* fix: calculate total disk usage of database to show in TUI
* wip
* exhaustive match
* write with fixed v1 strategy when writing for hashing
* local protocol version is 2
* cleanup "size" tests that exercise v1 vs v2 vs default protocol versions
* add proto version to Connected! log msg
* cleanup docs
* negotiate protocol version min(local, peer) when doing hand/shake