* allow version 2 blocks for next 6 months
* add cuckarood.rs with working tests
* switch cuckaroo to cuckarood at right heights
* reorder to reduce conditions
* remove _ prefix on used args; fix typo
* Make Valid Header Version dependant on ChainType
* Rustfmt
* Add tests, uncomment header v2
* Rustfmt
* Add FLOONET_FIRST_HARD_FORK height and simplify logic
* assume floonet stays closer to avg 60s block time
* move floonet hf forward by half a day
* update version in new block when previous no longer valid
* my next commit:-)
* micro optimization
* Implement simple zeroing of BlindingFactor in Drop
* rustfmt
* Make Debug implementation for BlindingFactor empty
* Implement BlindingFactor zeroing unit test
* mnemonic.rs: fix deprecated warning in test_bip39_random test
* Use zeroize crate to clear BlindingFactor
* Fix comment and implement dummy Debug trait for BlindingFactor
* Fix formatter
I made an suboptimal (aka stupid) decision to stop and wait for peers
one by one which makes shutdown very slow - O(n). This PR decouples sending
stop signal from waiting a thread to exit. On top of it in Peers we
first send stop signal to all peers and only after that start waiting
for them to exit. It gives us a constant time of shutdown in most of the
cases.
* Calculate reorg depth in BlockStatus::Reorg enum member
* rustfmt
* Fix reorg height calculation and implement reorg test
* rustfmt
* Report reorg depth in webhook payload
* Add optional depth field to the block webhook JSON reply
* fix: try to fix issue #2585 by adding block cleanup from db directly.
Signed-off-by: Mike Tang <daogangtang@gmail.com>
* use another effective algorithm to do old block and short-lived block cleaup.
Signed-off-by: Mike Tang <daogangtang@gmail.com>
* 1. rename iter_lived_blocks to blocks_iter;
2. comments and iterator calling optimiztions.
Signed-off-by: Mike Tang <daogangtang@gmail.com>
* Fix locking bug when calling is_on_current_chain() in batch.blocks_iter just by removing it.
Because "we want to delete block older (i.e. lower height) than tail.height".
Signed-off-by: Mike Tang <daogangtang@gmail.com>
* introduce HeaderVersion (was u16) for type safety
cleanup pow ser/deser (version unused)
* fixup tests for HeaderVersion
* validate header version during header deserialization
* connection no longer wrapped in an Option in peer
* introduce peer.send()
* remove some Arc indirection
* self.send() cleanup
* extract Peer:new() from connect and accept
* fixup
* cleanup
Fixes#2799
Also 2 Arc's were replaced by one server's instance.
It is needed for p2p thread management in #2778, currently there is no point where we could store thread handles and join them because thread::join
consume the caller, which is impossible in case of Arc.
* bucket_transactions is now fee_to_weight aware
bucket_transactions now returns the underlying txs
* cleanup
* simplify pool bucket sorting, no need for depth sort key