Commit Graph

517 Commits

Author SHA1 Message Date
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
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
AntiochP 45b9962109 introduce cpu_pool to read_msg (#477)
* introduce cpu_pool to read_msg

* cleanup and less unwrap() in handler

* expose cpu_pool as part of net_adapter (reuse across all peer connections and handlers)

* fix DummyAdaptor for test usage

* add new() to DummyAdapter for convenience
2017-12-13 15:05:25 -05:00
Ignotus Peverell d92b6ddddb Fix for disappearing AlreadySpent error
Fixes buffer misalignment when reading back pruning data.
Everything after the buffer length (8000 bytes) was badly read on
restart, leading to accepting double spends.
2017-12-12 23:43:05 +00:00
Simon B 8f77933f4f Fixes #469 (#470) 2017-12-12 19:12:07 +00:00
Simon B 30a9c3db1e Improve errors that confuse new users (#467)
* Make Get coinbase via wallet API error more self-help friendly. Also show the wallet API URL that failed to respond.
* spelling and rustfmt nit
* more informational output from `grin server stop`
* newcomer friendly error when wallet.seed isn't found
* grin wallet (info|outputs): better error message
2017-12-12 04:56:48 +00:00
AntiochP 8e6f54779e not sure how this ever worked... (#465) 2017-12-11 12:54:26 -05:00
AntiochP 1e796642c4 one liner, clean up unused warning use "?" for updating head (#464) 2017-12-11 11:03:21 -05:00
Simon B a4729b51ac Issue 458 too verbose slog lines initial sync (#459)
* Alleviate slog-async channel overflow by shortening while clarifying some log lines.

* add debug logging to GetBlock handling

* make another log line less rendudantly chatty
2017-12-11 09:51:52 -05:00
Simon B 8b81a2f806 Seed debug outputs cleanup (#460)
* DRY up

* iterate 66% less

* clarify debug! outputs

* less verbose peer queuing

Rationale: debug outputs that happen _a lot_ is nice if they're short and distinct, making them easier to pattern match / willfully ignore while reading through logs

* update comment to mention last weeks' added usecases

* .push() less
2017-12-11 09:38:46 -05:00
Yeastplume 18fc1384de updating secp256k tag to include aggsig library 2017-12-11 14:23:55 +00:00
Michalis Kargakis e13f622395 Add docs about cross-compiling ARM binaries (#457) 2017-12-10 18:42:39 +00:00
Ignotus Peverell 8c718443ef Explicit error when a forked block can't be retrieved 2017-12-09 21:43:42 +00:00
Ignotus Peverell 6ba22e71c8 Fix for buffer-pruned positions in MMR store
The MMR storage has a buffer for all changes so they can either
be discarded without side effects or committed to disk. Pruning
can also happen in the buffer if an input directly spends an
output in a block (not likely), or a fork has an input spending
a previous output within it.

When the buffer gets flushed to storage, the pruned element was
just skipped, causing an offset within the underlying storage and
a shorter file than expected. This fix writes zeroes instead, so
the size is consistent. Note that the zeroes will be removed with
all other pruned elements on next compaction.

Fixes #444
2017-12-09 18:53:24 +00:00
AntiochP 001fd3789c specify serde_json as "=1.0.7" to pin the version (#451) 2017-12-09 11:59:54 -05:00
AntiochP 0a87c0ced1 body_sync every 5s, but request 10*most_work_peers blocks at a time (#448)
header_sync every 10s
2017-12-08 17:12:10 +00:00
AntiochP a4e0b5c56a base threshold for sync on difficulty of past 5 blocks (#433)
* base threshold for sync on difficulty of past 5 blocks

* cleanup threshold calc filter_map + fold
2017-12-07 21:11:44 -05:00
AntiochP 10030a224a more aggressive peering (#445) (#446)
* [WIP] aggressive peer connections (and logging)

* get peer list from each connected peer when low on peers

* cleanup the try_read() calls and log consistent warning messages
(will clean these up later)

* cleanup error logging (log at debug level)
2017-12-07 20:24:03 -05:00
Maxime fa91e4dc15 homogenize MimbleWimble writing (#438) 2017-12-07 16:13:36 -05:00
Ignotus Peverell 68bb49dd61 Comment out unused for now 2017-12-07 19:12:27 +00:00
Ignotus Peverell f001006fc9 Re-introduce wallet config as part of global grin.toml
Wallet configuration was disabled presumably as wallet is its
own separate process. However people seem to still want to use
a single config for everything, which may be a sign that the
lifecycle of the wallet and the server should be the same by
default (with appropriate options to only start one).

Note that this does *not* mean that the wallet and the server
should share the same process. The wallet process can easily be
forked. But sharing the same config file may provide a lot of
future convenience.
2017-12-07 19:08:02 +00:00
Johnny Gannon 1ac8aa9978 Revert BlockHeaderInfo struct to contain only the fields needed for wallet reconstruction. Create a new struct for use in the /blocks api. (#442) 2017-12-07 09:27:55 +00:00