* Optimize POW read
This functionality is used to deserialize header (from network or from
DB), it was taking up to 40% cpu time during initial header sync. This
PR brings it down to 3-4%. Function read_number would look better as
closure, unfortunately the compliler doesn't inline it in this case, so
it would be 2x slower.
* Remove unused code
To convert option to error we generate an error message. In some places
it contains header or block hash code or other data which is costly to
produce. So during the initial header sync we spend 12% of all time on
generating those messages (in 99% cases we don't use it). This PR
introduces a lazy generation of error messages which completely
eliminates CPU load during the header sync.
* wip
* sync sort of works now
* get rid of the deadlock during compaction
there is *always* a deadlock in there when we make changes like this...
* cleanup how we rebuild the sync MMR on init
* cleanup rewind logic
* roll the "fix invalid root" changes into this PR
* move rebuild_height_pos_index into txhashset
and pass in header_pmmr for header lookups
* cleanup and remember to setup sync head on init
* cleanup unnecessary ref muts
* rebuild_height_pos_index when writing txhashset
* use head (not header_head) when rewinding to find fork point for full blocks
* get rid of shortcut when nothing to rewind - always something to rewind
* schnorr signature batch verification
* Split the fee and lock_height verification out from the batch signature verification
* Remove the new added fee_height_verify to comply with #2859
* fix: the last n could not be leaf?
* Kernel lookup api
* Min and max height parameters, scan backwards
* Return null instead of 404 if kernel not found
* Return TxKernel instead of TxKernelPrintable
* Update description of KernelHandler
* store both mmr index and block height into database for output
* rustfmt
* fix: mmr position is 1-based instead of 0-based
* (Hash, u64, u64) deserves a type
* Add check for p2p connection limits
* Simplify undesirable connection shutdown
* Make inbound and outbound connections more explicit
* Cleanup inbound and outbound connections
* Cleanup an outbound peers check
* Rename healthy_peers_mix to enough_outbound_peers
* be a lot less restrictive when picking some candidate peers to connect to
keep the peer address queue drained but actually attempt a healthy number of connections
as most of these attempts are going to fail due to majority of nodes not being publicly accessible
* fee and lock_height now maintained in kernel features enum variants
* sum fees via explicit enum variants
* cleanup semantics around with_fee and with_lock_height for tx builders
* document the kernel feature variants
* serialize kernel features correctly for api json
* cleanup
* commit
* bump to unstick azure
* Ban on cannot get block header in txhashset_write
* Rusfmt
* Fix typo
* Missing error handling
* Rustfmt
* Only accept txhashset from corresponding peer
* Switch to AtomicBool instead of RwLock<bool>
* Rustfmt
* maintain header_head as distinctly separate from head
* cleanup corrupted storage log msg
* simplify process_header and check_header_known
* remember to commit the batch when successfully processing a header...
* rework sync_block_headers for consistency with process_block_header
* cleanup unrelated code
* fix pool tests
* cleanup chain tests
* cleanup chain tests (reuse helpers more)
* cleanup - head not header on an extension
shortcircuit "rewind and apply fork" for headers if next header
* add files for translation
* WIP translation
* finish to translate coinbase_maturity.md && fix some typo to understand easily
* add doc link in coinbase_maturity.md
* remove wrong file
* Fix typo and unecessary word