Commit graph

737 commits

Author SHA1 Message Date
Quentin Le Sceller
c8383dac93 Add POST peers/a.b.c.d/unban in REST API (#571)
Add unban peer in rest API and clean TODO
2018-01-04 03:25:14 +00:00
yeastplume
c805f67020 adding clang dependency to build doc 2018-01-03 10:14:59 +00:00
Matthew Slipper
e83e696a6f Fix #506 - use OS-assigned port in peer_handshake (#570) 2018-01-03 01:53:50 +00:00
udiWertheimer
23e045d9b7 Add another rocksdb compile error fix to FAQ entry (#565)
On Fedora, Linux headers aren't enough to build `rocksdb`, as suggested in #549. `clang` is also required. Adds note to troubleshooting to help with this.
2018-01-03 01:05:56 +00:00
Quentin Le Sceller
7b13b25782 Add GET peers/a.b.c.d handler in REST API (#564)
* Change name of get_peer to get_connected_peer and add a get_peer method with store
* Change to get_connected_peer
* Added handler for GET peers/a.b.c.d
2018-01-03 01:03:44 +00:00
Harm Aarts
dc3a2113bd Add rocksdb compile error help (#563)
* Add minor document fixes

- fix broken link
- fix shell command formatting
- fix typo

* Add FAQ entry dealing with rocksdb

When compiling Grin without Linux headers the build process exits with
an opaque error message. Adding the header files fixes this.

References #549.
2017-12-31 21:47:26 +00:00
yeastplume
f08d386790 semversion regex dependency, as rocksdb build was failing as a result 2017-12-31 10:35:23 +00:00
AntiochP
30c20294f5
reset header_head and sync_head on peer ban (#551) (#553)
handle orphan blocks based on age (not fixed count)
2017-12-28 19:49:27 -05:00
Quentin Le Sceller
2057525251 Bump RocksDB to ^0.8.0 (#555) 2017-12-28 15:25:01 -05:00
AntiochP
2450ff376b
reset sync_head on restart (#546) (#550)
* reset sync_head on restart (handle banned peers and sync against invalid chain)

* reset both sync_head and header_head on restart
2017-12-27 19:09:11 -05:00
Daniel Tsui
521678bd23 Add kcov support (#545)
* Adding kcov code coverage to chain and core modules
* Adjust travis.yml to wget kcov from mimblewimble org
* Add codecov badge to README.md
* Fix repo name in badge to grin, from kcov
2017-12-27 02:09:10 +00:00
Ignotus Peverell
da4b349d49
Fix AlreadySpent when UTXO created and spent on fork
When applying a fork, everything is done in memory to be able to
rewind if it's either invalid or doesn't have more work. But
checking for the UTXO index was done only against the store. Now
checking the memory as well to find UTXOs that haven't been
stored yet.
2017-12-25 00:32:39 +00:00
Ignotus Peverell
707a2073a5
Fix is_unspent to consider MMR and not only index
The method `is_unspent` hadn't been fixed with the other sumtree
functions to check the MMR before deciding whether something is
really unspent. This is now fixed and also checks the output
hash is the one we expect.
2017-12-25 00:31:51 +00:00
Quentin Le Sceller
2dac10a690 Display chain status with grin client status (#543)
* Add term and grin_p2p for grin client

* Setting msg as public for the client

* Specifying binary for cargo build

* Minimal client implementation

* Using server configuration for the client

* Display current chain height

* Display difficulty and last block pushed

* Remove unneeded secp256k1 dependency
2017-12-22 18:46:28 +00:00
AntiochP
4ba453694d
fix - sort tx inputs/outputs (#533) (#542)
* added debug logging to see what we're doing in save_pos_index

* add counts to logging

* make sure inputs/outputs in tx are sorted
tweak debug logging

* DRY up sorting of inputs/outputs/kernels via a simple sort() in ser/deser

* add explicit validation fo sort order during tx and block validation

* sort order consensus rule for inputs/outputs/kernels in blocks

* we want a max of 10*num_peers blocks during sync...
not min

* fix test imports
2017-12-22 12:15:44 -05:00
AntiochP
9ddb1489a5
Smarter orphan blocks (#537)
* wip

* rework check_orphans to be smart about _which_ orphan(s) to check

* cleanup

* limit max of 100 blocks at a time, and corresponding 100 max orphan blocks
2017-12-21 17:29:24 -05:00
Ignotus Peverell
74ba0d5e88
Fix small typo and remove traling spaces at PoW docs (#534)
Fix small typo and remove traling spaces at PoW docs
2017-12-21 19:32:43 +00:00
AntiochP
f8bb55a086
fixup error handling in wallet restore (was failing when unable to recover amount) (#526) (#527) 2017-12-20 17:16:40 -05:00
Ignotus Peverell
c5a055db1e
Merge pull request #528 from antiochp/git_commit_hook_fix
fix the bash array loop
2017-12-20 20:51:31 +00:00
antiochp
121cce7e51
fix the bash array loop 2017-12-20 15:37:23 -05:00
AntiochP
6ff4b41f2e
100_000 keys max in a wallet (was 10_000) and someone maxed this out... (#520) 2017-12-18 20:33:44 -05:00
AntiochP
ea752d509b
fix build warning about unreachable code (#519) 2017-12-18 20:33:27 -05:00
AntiochP
b37820bd40
broadcast all accepted blocks, main chain or fork (#515) (#517)
tweak logging to be more consistent
2017-12-18 16:18:36 -05:00
Simon B
99186e90f0 better error messages + some cleanup (#497)
* distinguish select (among futures) from select coins. Regex search in project for select\b shows we hardly use select, but maybe could use it to add timeouts more cleanly. ("Want to add a timeout to any future? Just do a select of that future and a timeout future!" from https://aturon.github.io/blog/2016/08/11/futures/)

* remove a trailing space

* FAQ.md - fix typo

* wallet: display problematic tx

* update FAQ build troubleshooting to cover #443

* stdout_log_level = Info
file_log_level = Debug

* sync: show total diff @ height when syncronization is completed

* better wallet send dest format error

* move INFO "Client conn ... lost" and "Connected to peer" down to Debug

* move some level=Info to Debug, add 1000-block outputs
2017-12-18 08:17:11 -05:00
AntiochP
3b5e6d3e1f
pass the commitment into an AlreadySpent error (#511) 2017-12-18 07:46:19 -05:00
Ignotus Peverell
2caa0b79e0
Removed log should *always* be backed up before truncate 2017-12-17 21:26:43 +00:00
AntiochP
5b0fc60fe2
add logging around handling of orphan blocks (#500)
add some unrelated block validation comments
2017-12-15 22:19:04 -05:00
AntiochP
982e02a6b9
fix failing cargo build (#501) 2017-12-15 21:17:27 -05:00
Ignotus Peverell
515aacc73c
Remove future block heights from store when backtracking
Fixes #499
2017-12-16 00:30:55 +00:00
Roman Zeyde
6bdc28e4e0 Fix small typo and remove traling spaces at PoW docs 2017-12-15 10:14:14 +02:00
AntiochP
9e94d3bd6c
broadcast to subset of peers (in case we are connected to more than preferred number of peers) (#488) (#489) 2017-12-14 15:33:22 -05:00
Simon B
c59f3ddb7c add doc/FAQ#troubleshooting for serde_json version select error + link to it from build.md (#487) 2017-12-14 13:07:26 -05:00
Simon B
1159834321 update api index (GET /v1) to also list peer banning (#486) 2017-12-14 12:44:06 -05:00
AntiochP
b17e42fb42
[testnet1] De-Duplicate expected responses in TimeoutConnection (#484) (#485)
* timeout connection already tracks "expected" responses
use this to deduplicate requests and do not ask a peer for the same thing again
(until either success or timeout)

* do not ask for orphan blocks repeatedly
allow more than preferred number of peers (clean if we exceed max number)
2017-12-14 12:23:35 -05:00
Simon B
38741c91e2 cherry-pick "[testnet1] cpu_pool and buffered fold in read_msg (#479)" (#482) 2017-12-14 07:19:43 -05:00
Simon B
590cb8b8dd Travis speedups (#483)
* move fast tests towards the end, slow tests to the front. avoids having a long running test straggling behind when other tests have finished

* testing if we can manage also with "sudo: false"

* reorder tasks a bit more
2017-12-14 07:17:55 -05:00
Ignotus Peverell
360e311041
Merge pull request #481 from sesam/more-cherries
Cherry picks + Ext. peers handling (#468) + compare genesis during handshake (#327)
2017-12-14 03:29:48 +00:00
AntiochP
487e50c3d2 compare genesis during peering handshake (#327)
* wip - send genesis in handshake
* error if genesis mismatch on handshake
* fix the tests
* preserve order of existing fields in hand/shake
2017-12-14 01:13:05 +01:00
Ignotus Peverell
e50703d79e Externalized all peers selection and handling (#468)
Moved handling to the peer map out of the p2p server and into
its own struct. Allowed factoring code from the net adapter and
simplification of some interactions. Also removes the need for
the adapter to reference the p2p server or peers.

Fixes #430, #453 and #456
2017-12-14 01:13:05 +01:00
Ignotus Peverell
4a03b90190 Name all threads 2017-12-14 01:13:04 +01:00
Ignotus Peverell
be094883de Improved fix for MMR dup detection 2017-12-14 01:13:04 +01:00
Ignotus Peverell
cac6181c21 Check before borrow, fixes #267 2017-12-14 01:13:04 +01:00
Marco Tanzi
1a86900bac Removed annoying warning during the build (#420) 2017-12-14 01:13:04 +01:00
Andrew Bellenie
7ef752f61c Breakout listen -i to separate method (#337)
* Rename wallet 'receive' to 'listen'
* Handle use of previous 'receive' command gracefully and clarify docs
* Move listen port from main wallet config to subcommand and break input out into own file method
* Clean up arg description
* Add placeholder to docs for file method in wallet
* Tidy wallet help text
* Rename pending wallet 'receive' to 'request'
* Restore receive method for file based transactions
2017-12-14 01:13:04 +01:00
Ignotus Peverell
b893a6c8ee Back up the removed log before truncating in memory
Without a backup, the in-memory data structure stays truncated
even if the rewind is abandoned. Also add some logging on our
most problematic block in case it still is problematic.
2017-12-14 01:13:04 +01:00
Ignotus Peverell
6b48e7840d Fix for locator response generation
When generating the locator, we just looked for the first block
in the locator we had locally. However that block could be on a
losing fork, in which case we replied with blocks from that losing
fork, making things worse. Now building the locator only based on
blocks in our winning fork.
2017-12-14 01:13:04 +01:00
Ignotus Peverell
060be4b827 We do not want to sync with old peers anyway 2017-12-14 01:13:04 +01:00
Ignotus Peverell
f8a9526279 Check before borrow, fixes #267 2017-12-14 01:13:04 +01:00
Simon B
17d5898677 Forgotten testnet1 cherries (#475)
* Very quick peer banning endpoint, helps with #406
* Ping heights (#407)
* add height to ping/ping
* reformat output
* fix p2p test
* Fix orphan handling, not related to current head. Fixes #412
* Check before borrow, fixes #267
* Not finding an output commit in pos is an AlreadySpent
* Fix race condition, sending before conn is ready
* Explicit error for unknown pos of a forked block
* Remove config outdated tests. Fix #333
* Check ref and try before borrow, fix #400
* We do not want to sync with old peers anyway
* Hide cargo compiler warning for unused NoopAdapter and unused test code. Add TODOs
2017-12-13 21:52:21 +00:00
AntiochP
bffd955c26
Revert "introduce cpu_pool to read_msg (#477)" (#478)
This reverts commit 45b9962109.
2017-12-13 16:30:59 -05:00