Commit graph

1127 commits

Author SHA1 Message Date
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
Antioch Peverell
bb7bc2c4f2
Refactor rewind single header (#1390)
* refactor txhashset to only take a single header
no need to pass in current head_header each time

* rustfmt

* fix bug introduced in rewind with LMDB

* rustfmt

* add some comments
2018-08-20 20:34:12 +01:00
Yeastplume
8440aad7ea
Retrieve header by output commit (#1388)
* Add get_header_for_output function to chain

* add api call to retrieve associated header for a given output

* rustfmt
2018-08-20 19:02:44 +01:00
Antioch Peverell
82a467ac3c
Fix txpool race condition (#1385)
* fix txpool race condition

* rustfmt

* fixup pool tests

* rustfmt

* rebase against master, pool tests passing
2018-08-20 14:48:05 +01:00
Ignotus Peverell
ef4f426474
Sort pool tx by fee over weight for mining (#1346)
* Sort pool tx by fee over weight for mining. Fixes #1105
* Bucketing dependent transactions before weighing. Minor tx weight fixes.
* Limit length of tx chain, cleanup and test fixes
* Cleanup all mining references to a hardcoded tx count
* Small test improvement, cleanup
2018-08-19 18:50:43 -04:00
Gary Yu
743c845259 fix: deriv_idx is not updated after wallet restore (#1306) (#1374)
* fix: deriv_idx is not updated after wallet restore (#1306)

* rustfmt check
2018-08-19 19:27:04 +01:00
Antioch Peverell
5abefbff33
improve logging when receiving blocks and txs (msg_len) (#1383)
* better logging for msg_len and # kernels

* rustfmt
2018-08-19 18:15:42 +01:00
Gary Yu
7d677737d7 add impl fmt::Debug for BlindingFactor, for pretty print (#1382) 2018-08-19 12:57:04 +01:00
Antioch Peverell
25e03aadef
Tx (change) output splitter (#1369)
* wip - split change into many outputs for testing

* rustfmt

* add change_outputs param to wallet send
default to 1

* commit

* rustfmt

* cleanup

* fixup servers tests
2018-08-18 22:38:48 +01:00
Antioch Peverell
c05c5e21ea
Fix config defaults (#1376)
* fix global defaults to reflect grin.toml

* rustfmt
2018-08-18 17:32:04 +01:00
Antioch Peverell
686f7517ed
fixup Cargo.lock (#1377) 2018-08-18 16:41:00 +01:00
yeastplume
d5f7f4cf2f default run_wallet_owner_api to false 2018-08-18 13:48:43 +01:00
Gary Yu
4da92c5d75 minor fix: prefix code conflict between 'COMMITMENT_PREFIX' and 'CONFIRMED_HEIGHT_PREFIX' (#1375) 2018-08-18 13:23:31 +01:00
Ignotus Peverell
630d0a0438
Buffered txhashset temp file write 2018-08-18 02:52:44 +01:00
Quentin Le Sceller
59f4806a2c Update wallet restore error message (#1368) 2018-08-17 14:04:23 -04:00
Yeastplume
103c9cda77
Serve up web wallet application (#1367)
* first addition of static wallet file server

* rustfmt

* add custom build functions to download and untar particular release of the web-wallet

* rustfmt

* remove comments
2018-08-17 18:51:50 +01:00
Mike Dallas
adeaea4622 Truncate trailing zeroes in coin amounts (#1366)
* truncate coin amounts
* truncate datetimes
* fixed formatting
2018-08-17 13:05:35 -04:00
hashmap
f7161a9afb Improve API handlers (#1364)
* Return different status codes depending on result, not just BAD_REQUEST, fixes #1247
* Reduce number of unwraps
* Refactoring
2018-08-17 13:04:02 -04:00
Gary Yu
54d3fc0af2 improve: use batch verification for txhashset rangeproof validation (#1321) (#1363)
* improve: use bullet rangeproof batch verification for txhashset validation (#1321)

* update rust-secp256k1-zkp to tag 'grin_integration_22'
2018-08-17 16:18:48 +01:00
Antioch Peverell
a10557c756
grin wallet outputs now displays output commitments (#1365)
* commit - wip

* rustfmt

* save output commitment when saving output in wallet

* rustfmt

* fixup wallet tests with commitments in the wallet db

* rustfmt
2018-08-17 12:15:06 +01:00
Ignotus Peverell
d47a3bc225
Simplify and improve headers_received (#1362) 2018-08-16 22:30:05 -04:00
Ignotus Peverell
b4febf2e40
Test teardown cleanup fix
Can't reproduce the current failing of servers tests, but stopping
the servers cleanly can't hurt. I think.
2018-08-17 01:31:51 +01:00
Ignotus Peverell
dcfbda9c89
Fix test logger, debug level, no file 2018-08-16 19:32:03 +01:00
hashmap
779921f71a Fix compiler warnings (#1361)
* env::home_dir is deprecated, compiler suggests to use crate `dirs`
* add superficial comments to file util module
2018-08-15 17:11:05 -07:00
Ignotus Peverell
6775112f61
Introduce cut_through method to avoid code duplication (#1355)
* Introduce cut_through method to avoid code duplication
* Improve error handling, fix sorting.
2018-08-15 16:20:33 -07:00
hashmap
99a66c1960
Consolidate validation in Block and Transaction (#1354)
* Consolidate validation in Block and Transaction

Introduce TransactionBody which is included into block and tx.
Fixes #1333
2018-08-15 23:14:48 +02:00
hashmap
37fa413329 Fix small issues found by fuzzing (#1360)
Overage and fee come from the network and may cause overflow if a message was corrupted or crafted to attack a server.
2018-08-15 11:55:25 -07:00
Yeastplume
e70ff53c3c
Use tagged version of rust-libsecp256k1 (#1359) 2018-08-15 17:02:06 +01:00
hashmap
a2fac26282 Add network hashrate info to Mining pane in TUI (#1353)
Found it's useful, we even have a section in user docs for that https://github.com/mimblewimble/docs/wiki/Testnet3-FAQ
2018-08-14 10:01:20 -07:00
Quentin Le Sceller
6b74cf5098
Unpin croaring to version 0.3.2 (#1352) 2018-08-14 08:28:58 -04:00
Michalis Kargakis
dda88f193b Fix typo + git ignore wallet data (#1350)
* Ignore wallet data

* Fix typo
2018-08-13 23:28:01 +01:00
Ignotus Peverell
6f590b3f88
Halve max block weight (#1347) 2018-08-13 14:06:53 -07:00
Ignotus Peverell
e9c987c075
Consolidate and cleanup tx aggregation (#1332)
* Include commitments non-duplicate checks in aggregate
* Remove said check from the pool
* Block building now uses tx aggregation to reduce duplication
2018-08-12 19:08:08 -07:00
Ignotus Peverell
4be97abbbb
Cleanup max sizes (#1345)
* Transaction max weight expressed in terms of block weight
* Cleaned up max block sizes, so everything is in therms of weight
* Cleanup block max constants
* Rename verify_size -> verify_weight
2018-08-12 13:02:30 -07:00