When rewinding, it's possible to have a commitment (or kernel)
identical to the one we're adding both in the index and in the
data file (because it's not truncated by rewind, by design). To
detect this, we just need to make sure we don't look for anything
past the size of the rewound MMR.
* Implement /block api endpoint displaying basic information
* Add block inputs and kernels to the api output.
* Add fields to BlockHeaderInfo and TxKernelPrintable
* Add features debug string to TxKernelPrintable.
* Return 400 and 404 statuses from the blocks api endpoint.
* For the blocks api, return a 404 if a block is not found at the requested height
* Add back hash to BlockHeader api output.
* simplify sync process further - one thread, try_read on peer for robustness
* add most_work_peers() for convenience, add most_work_peers count to "monitoring peers" log msg
Added support for peer banning on the p2p server. The peer status
is changed and the peer is disconnected. A banned peer won't be
able to reconnect as well.
Tracking of chain errors due to a block that's intrinsically bad
and banning of the peer that sent it. If we're syncing, resetting
the header chain to the same as the main chain to force
backtracking.
* intial docs and images to describe receiving a block and simple sync.
* add some more description text
* svg -> png
* updated simple_sync diagram to include sync_head
* rename "block head" -> "body head"
* wip - sync_on_form diagram (kill me now)
* tidy up diagram for "sync on fork"
* consolidate the chain docs
* port simple_sync across from testnet1, sync head & improved fork handling
* introduce new sync_head for tracking header chain during sync
* add debug logging in body_sync for state of various heads
* update header_head during sync if header is now the one with most work, pass in sync and head contexts to pipe
* port across sync_head changes from master, put the 1s sleep back in...
* let sync run even if the full 512 headers are all known, give sync a chance to sync against a fork that forked a long time ago
* handle height jumping during a reorg
block validaton should not check for height+1 based on head
no assumptions should be made about height indices
* quick(er) check for previous block in process_block (we cannot check height against ctx head)
* make body_sync a _lot_ faster by finding the forked block more efficiently...
* fix monitoring peers log msg
* fix chain tests
* fix grin tests - we were using the wrong genesis hash (wrong chain type)
* apparently needs setting in both places...
* body -> header -> sync (#414)
* port over body -> header -> sync changes from testnet1
* port across "simple_sync" changes from testnet1 branch
Cleanup direct refs to peer map or peer store
P2P server acts as a facade, handling the list of connected peers
and the storage of their information. Everything else goes through
the p2p server instead of having a peer map reference or going
straight to the store.
Fix p2p tests
* fix "monitoring peers" log msg (use connected_peers)
Only the temporary remove log for the last block was written to
disk, and then overwritten for every block. The fix writes the
temp remove log (just last block) to the permanent remove log,
and saves that to disk.
* FAQ: fix capitalization
* FAQ: friendlier answers. Move Q: crash/hangs under the Troubleshooting section
* FAQ: add missing A for block size/target mean time
* FAQ: Add link to grintest.net (see also #325)
* FAQ corrections
- link to Scripting discussion
- Quantum unsafe, says A.P.
Duplicate commitment and ducplicate kernel errors, as well as
`is_unspent` did not check the total PMMR size, leading to
wrong detection of duplicates or unspent.
And error in the sync run loop would just exit it silently. Abort
with a panic instead.
Peer errors (like disconnect) on locator request was bubling up in
the loop. Just logging instead.
* add total_diff to ping/pong msgs
debug log for total_diff on each ping/pong
* expose peer addr to the handle_payload fn
so we know where it came from
* fix p2p tests for ping
* default to 0 if we cannot read total_difficulty
* updating a connected peer in place
* actually update peer info diff
* fixup p2p tests
* add doc/table_of_contents, initial attempt, based on https://lists.launchpad.net/mimblewimble/msg00024.html
And explain and link to build.md about creating folders server and wallet manually.
* add Files in this folder (doc)
* rename headlines
* docs: extract code and directory structure to code_structure.md
* beginning to add wallet restore... api endpoints and basic restore
* basic restore working, still missing features
* rustfmt
* large speed up to output search, should be more or less working
* properly mark coinbase status
* ensure only unspent utxos are returned from sumtree
Fixes#281 by doing:
- "Starting validation pipeline for " -> "Processing "
- stdout logging default = Warning
- ERR -> INFO for "Transaction rejected: Already in pool" -- only for netadapter transaction_received, which (hopefully!) only gets tx from peers, and lots of those will be duplicates, that's good and not an error.
* Downgrade ERR even down to DEBUG.
Also let Transaction rejected show tx hash,
so users can check if such a rejection is for the
payment they expected, or just any random peer
sending in some old and already known tx.
* Limit number of inputs in a block, fix#261
* MAX_BLOCK_INPUTS = 300_000 // IO-time bound DoS protection. 5MB/s disk random reads gives ~150k UTXO lookups/s, so set limit at 300k UTXO inputs
* beginning to add wallet restore... api endpoints and basic restore
* basic restore working, still missing features
* rustfmt
* large speed up to output search, should be more or less working
* properly mark coinbase status
* Aiming for #286 - quick placeholder to have at least something to help your memory
* corrections:pool/push get->post, add sumtrees/(roots|lastutxos|lastrangeproofs|lastkernels)
* use a short timeout when opening the connection to possible peers
lots of peers in the db are unavailable and we do not want to wait 60s for these
* also randomize peers so we don't always try and connect to peers with low ip addresses
* bump timeout up to 5s for peering