Commit graph

1210 commits

Author SHA1 Message Date
hashmap
0172a3e020 Fix amount parsing (from string) (#1458)
* Fix amount parsing (from string). Fixes #1384
* Add conversion with string padding
* Use string padding
2018-09-03 15:55:04 -04:00
Blade Doyle
a1141cab39 Record ideal miner behavior based on job_id value (#1461)
We have a very low default value for "attempt_time_per_block", which exposed an issue with the miner.  This change documents the correct / ideal behavior.
2018-09-03 19:15:18 +01:00
Antioch Peverell
b06b112afb
document/comment pipe::process_block() (#1472)
* document what we do during pipe::apply_block()

* rustfmt
2018-09-03 16:55:09 +01:00
Quentin Le Sceller
45fffd8534
Missing logic in preferred peers (#1471) 2018-09-03 16:27:40 +02:00
Antioch Peverell
0cbfeaab94
Faster tx known check (#1468)
* fast check for known tx when adding to pool

* rustfmt
2018-09-03 12:35:37 +01:00
Quentin Le Sceller
544a296f77
Fix typos and unused imports (#1466)
* Fix typos and unused imports
2018-09-03 13:09:28 +02:00
Antioch Peverell
eae0ab6b2a
take write lock on txhashet earlier when processing blocks (#1456)
* take write lock on txhashet earlier when processing blocks

* no txhashset lock in process_block_header
2018-09-03 11:09:53 +01:00
Ignotus Peverell
9f7625e8aa
Single line package install for Debian-based distros 2018-09-01 23:17:25 +01:00
hashmap
fa00a0ebe6
Implement exponential backoff for peer monitoring at startup (#1459)
* Implement exponential backoff for peer monitoring at startup

Fixes #1413
2018-09-01 23:25:47 +02:00
Gary Yu
60d62bfb97 add a test case for transaction deserialize (#1356) (#1381)
* add a test case for transaction deserialize (#1356)
* update rust-secp256k1-zkp to grin_integration_23
* add transaction explicit validation
2018-09-01 15:14:10 -04:00
Gary Yu
f971e8de77 infinite loops in check_orphans, if block in orphans has a forked parent (#1452)
* fix: if block in orphans queue has a forked parent, cause infinite loop in check_orphans()
* process all orphans at a given height before go to next height
2018-09-01 15:09:38 -04:00
Gary Yu
8a39f1fc75 Use 10us sleep instead of 1ms sleep (#1453) 2018-08-31 13:20:59 -04:00
Gary Yu
2f41003f90 update Cursive to 0.9 and change Crate to official (#1445)
* update Cursive (TUI library) from 0.8 to 0.9; and change Crate to official https://github.com/gyscos/Cursive

* use simple cursive = "0.9.0" in Cargo.toml
2018-08-31 11:35:31 +01:00
Gary Yu
d719493483 HeaderSync optimization (#1372) (#1400)
* improve: HeaderSync optimization (#1372)
* remove get_locator() optimization, which should be an independent pr for security review
* refactoring: move 'headers_streaming_body()' from Message to Protocol
* move 2 headers utils functions out of Protocol, and remove 'pub'
* support reading variable size of BlockHeader, from Cuckoo30 to Cuckoo36
* fix: use global::min_sizeshift() instead of hardcoded 30, because Cuckoo10 will be used for AutomatedTesting chain
* fix: should use global::proofsize() instead of hardcoded 42 when calculate serialized_size_of_header
* replace another 42 with global::proofsize()
2018-08-30 19:50:55 -04:00
Antioch Peverell
6d992e61d6 Add test coverage for verifier_cache 2018-08-30 15:08:16 -04:00
Antioch Peverell
939d391e0e
cache rangeproof and kernel signature verification results (#1419)
* wip - cache rangeproof verification

* rustfmt

* rustfmt

* rename to ok_verifier

* rustfmt

* wire in caching verifier in more places
skip rangeproof and kernel signature verification during deserialization

* rustfmt

* actually cache verification results via ok verifier

* rustfmt

* cleanup

* pass a cache around, not a verifier

* rustfmt

* cleanup trait shenanigans

* rustfmt

* core tests passing

* rustfmt

* rustfmt

* tests passing

* rustfmt

* verifier cache now takes vecs of data in and out

* rustfmt

* logging + rustfmt

* add docs and comments
2018-08-30 15:44:34 +01:00
Gary Yu
9a127d6291 complete the 'simulate_seeding' test case for automatic test (#1441)
complete the 'simulate_seeding' test case for automatic test
2018-08-30 14:58:49 +02:00
yeastplume
da0100bffb create a binary on tag 2018-08-30 12:02:04 +01:00
Yeastplume
11d24fe0c1
update docs to reflect new file layout (#1444) 2018-08-30 11:47:04 +01:00
Yeastplume
1ded3f3972
Config + Default directories (#1433)
* config file can now be generated by executable

* rustfmt

* remove now-unnecessary config defaults test

* set up paths and config file creation in user's home directory

* rustfmt

* remove default grin.toml

* add grin configuration command to spit out config file

* Split configuration into wallet and server

* rustfmt

* Restore logging to wallet configurations

* rustfmt
2018-08-30 10:10:40 +01:00
Gary Yu
471e80e69e fix for peer connect fail on 'WouldBlock' Error (#1440)
* fix for fail of peer connect: 'WouldBlock' Error.

* reuse the blocking variation of read_exact instead of re-implementing the loop
2018-08-30 08:21:13 +01:00
JackRack
436e68d6e0 Updated docs (#1418)
Updated docs to reflect new dependencies
2018-08-29 14:09:53 -04:00
Antioch Peverell
e5d43fee44
tweak excess example in docs (#1443)
* tweak excess example in docs

* remove reference to ECDSA signature.
remove references to passing sums of blinding factors around

* cleanup reference to _what_ is signed

* tweak who knows the private key
2018-08-29 12:54:33 +01:00
Antioch Peverell
c334c557aa
Simplify tx.validate() and transaction::aggregate() (#1436)
* simplify tx validation and aggregation
we *only* need to account for reward when building a block from txs

* rustfmt

* cleanup and tests passing

* rustfmt

* better comments in with_reward()

* fix wallet tests
2018-08-28 20:00:25 +01:00
hashmap
3dacc6a397
Merge pull request #1435 from yourowncrypto/fix-peer-ban
Fix non-atomic peer update
2018-08-28 15:58:23 +02:00
hashmap
67d2a04e92 Fix non-atomic peer update 2018-08-28 13:26:47 +02:00
hashmap
4a76336a59
Merge pull request #1432 from yourowncrypto/fix-outputs-by-id
Fix flakiness of simple_server_wallet test
2018-08-28 13:14:26 +02:00
hashmap
5e57e9c8e9 Fix flakiness of simple_server_wallet test
It produces 1000+ otputs on a fast machine (?) and generates invalid URL as result (too many paramaters). We don't care about sending all outputs in this test, we just need something.
2018-08-28 11:52:44 +02:00
hashmap
ff2612ca46 Fix test container and remove backtraces (#1430)
* Local test container used different folder than regular server, so test could not find txhashset files
* Error stacktrace was printed in cases when error was expected, which created some noise and confusion
2018-08-27 21:48:15 -04:00
Ignotus Peverell
4048a3011a
Improve file-based tx send to not use private file (#1421)
Instead of generating a private file on send that needs to be
provided again in finalize, the private context information is
saved in the wallet db.

Also move internal Context to bona fide libwallet type
2018-08-27 20:57:33 -04:00
Gary Yu
a58558b38e improve: get_locator optimization (#1372) (#1411)
* refactoring get_locator(), to ensure the gap between neighbours >= 2^n
* security enhancement for get_locator
* in case of sync head and the header head are different, clear history locators
2018-08-27 17:42:57 -04:00
Antioch Peverell
a6bd81fdb3 Cleanup generics (where not needed) (#1429)
BlockChain does not need to be generic
2018-08-27 17:22:48 -04:00
Marcin Jachymiak
dd164e153d Fix link to pre-commit hook (#1431) 2018-08-27 17:20:21 -04:00
Antioch Peverell
bd03528d33
lightweight validation during deserialization (#1422)
* introduce validate_read (for lightweight validation when reading)

* rustfmt
2018-08-26 11:43:44 +01:00
Ignotus Peverell
953d910776
Quick build guide update 2018-08-24 20:10:22 +01:00
yeastplume
04e6517806 tweak server test params 2018-08-24 15:51:32 +01:00
yeastplume
c449d35dd2 tweak server test params 2018-08-24 15:51:13 +01:00
Yeastplume
8b6ce33cfc
Automated test for #1325 (#1415)
* add test to replicate #1325

* rustfmt
2018-08-24 14:45:14 +01:00
Quentin Le Sceller
8cd1b23f7a Add a peers_preferred option in Grin (#1401)
* Preferred peers option
* Move P2P configuration into proper config part
* Fix tests
2018-08-23 15:16:04 -04:00
Yeastplume
2251a82404
batch verify proofs during validation (#1412)
* batch verify proofs during validation

* don't attempt to batch verify proofs with empty vec
2018-08-23 18:53:42 +01:00
hashmap
7dd2888b71 Get peers as quick as possible (#1398)
* Get peers as quick as possible. Currently we get 2 peers and then wait 20 seconds before trying to get more
* Second pass
* Fix peer_count
2018-08-22 21:31:06 -04:00
Ignotus Peverell
9554f93e1d
Run header sync only when stalled or complete (#1393)
Header sync used to run when complete (right count of blocks
received) or every 10 sec regardless. Sometimes 10 secs is not
enough, especially when a big batch of blocks bodies is arriving
at the same time.

This tweaks the time-based heuristic just a bit to only ask for
headers when stalled, meaning that the header head has not
*progressed* for 10 seconds.

* Fix bad header sync timeout logic

* Improve stability of fast sync test
Adds regular pings so that the 2 test servers know each others'
heights (necessary to find most work peer). Stop mining on the
first server once the 2nd kicks in. Avoids chasing a fast moving
target on Cuckoo10.
2018-08-22 19:51:25 -04:00
Antioch Peverell
7dfca6077c
Refactor compact block body (#1394)
* introduce CompactBlockBody

* rustfmt

* implement From<Block> for CompactBlock

* rustfmt

* remove debug logging

* wip

* rustfmt
2018-08-22 20:19:37 +01:00
Antioch Peverell
105bfacaa6
use chrono for timestamp in with_reward (#1406) 2018-08-22 15:40:24 +01:00
Yeastplume
ccc9c0db90
Wallet Restore fixes and updates (#1399)
* add wallet restore tests

* rustfmt

* begin to add tests for wallet restore

* rustfmt

* complete wallet restore automated tests, correct wallet restore heights and ensure TX log is repopulated on restore
2018-08-21 18:05:28 +01:00
Gary Yu
b4c2a9d1b2 Automatic setting up git hooks for the project: rustfmt, etc. (#1380)
Also update document for this change on pre-commit hook config
2018-08-21 12:52:37 -04:00
Yeastplume
b74e0fbc1f
Ensure wallet output heights are always correct (#1395)
* ensure block heights are always returned from API and updated within wallet

* fix api test
2018-08-21 14:04:14 +01:00
hashmap
631201358f Refactor and optimise peers.rs (#1389)
* Use internal hashmap for count and contains methods instead of relying on
connected_peers method which is expensive (creates vector from hashmap)
* Reduce number of `clone()`
* Refactor broadcast_xxx
2018-08-20 18:32:13 -04:00
Antioch Peverell
8c820a8929 Fast check for duplicate tx in the pool (#1392) 2018-08-20 18:02:28 -04:00
Antioch Peverell
7ca4d45bf5
Cleanup build warnings (#1391)
* cleanup some unused vars etc.

* rustfmt
2018-08-20 21:56:32 +01:00