Commit graph

1192 commits

Author SHA1 Message Date
Gary Yu
4a5a91a9cf Fix: clean_peers is using connected_peers, which make it do nothing (#1505)
* a failed handshake for example don't deserve banning
* remove not used 'BadOthers' from ReasonForBan
2018-09-13 09:53:35 -07:00
Gary Yu
644c1367b8 fix: too many words in a 1st level title (#1520) 2018-09-13 09:46:57 -07:00
Gary Yu
5291a061f1 Update the chinese intro for recent changes in english intro (#1519) 2018-09-12 21:22:49 -07:00
Gary Yu
1db1a02934 fix the comments of test bitmap (#1516) 2018-09-12 16:16:13 +01:00
Antioch Peverell
dca0d52dcd
Cleanup transaction with offset (#1514)
* cleanup build::transaction_with_offset

* rustfmt
2018-09-12 12:17:36 +01:00
Antioch Peverell
07eefc4d6b
cache get_shift() and get_leaf_shift() in prune_list (#1495)
* cache shift and leaf_shift values in prune_list for fast lookup later

* rustfmt

* fixup core tests
2018-09-12 08:19:05 +01:00
Parth Chopra
3eacc06a97 fixed list of requirements (pkg-config) (#1510)
pkg-config was incorrectly spelled pkc-config
2018-09-12 08:09:40 +01:00
Ignotus Peverell
a83404b22e
Simplify mining header serialization (#1509) 2018-09-11 20:31:05 -07:00
Gary Yu
97be1bf93e Fix wrong location of p2p config comments (#1511)
* remove 'WebStatic' from seeding_type
2018-09-11 20:30:24 -07:00
Gary Yu
7a689d468c Remove 'WebStatic' seed_type since it was obsoleted a while ago (#1512) 2018-09-11 20:28:27 -07:00
Antioch Peverell
77c2408c4e
Prevent duplicate output commitments (#1500)
* apply_output checks for duplicate commitment
not just a matching hash

* rustfmt
2018-09-11 19:36:00 +01:00
Quentin Le Sceller
596bf06556
Typo in logs (#1506) 2018-09-11 08:55:14 -04:00
Gary Yu
0dbfed5971 return an Err when read return 0 (#1503)
* return an Err when read return 0, instead of all zeroed buff without any error
2018-09-11 13:14:48 +02:00
Quentin Le Sceller
dd1cef2148 Add file based transaction in owner API (#1484)
* Add file based transaction in owner API
* Add finalize tx in owner API
* Code cleanup and placed file_receive in correct API
* Output an explicit error when http dest seems incorrect
* Add doc on send method
* Add cancel tx endpoint in owner API
* Add dump stored tx endpoint in owner API
*  Add missing parameters
2018-09-10 19:18:10 -07:00
Ignotus Peverell
4030b3d2f1
POW nonce has to be sent through stratum 2018-09-11 00:01:10 +00:00
Ignotus Peverell
6958f1c69e
First pass at Grin's security policy 2018-09-10 22:52:17 +00:00
Ignotus Peverell
ecf20602d5
Hard fork tryout: better PoW encapsulation in block header (#1478)
* Improve encapsulation with ProofOfWork struct
* Add dual pow scaling factor, fix test
* Fix pre_pow serialization, chain tests
* Adjust header serialized size calc
* Hard fork handling, version-based serialization
2018-09-10 15:36:57 -07:00
Gary Yu
48857b7e16 Fix infinite loop in case of some peer connect errors (#1494) 2018-09-10 15:23:49 -07:00
Gary Yu
e760ea2ce2 a little bit speed-up for full node syncing (#1463)
* simplified: track the head and orphans instead of every single block hash that sync requests
* change 1st block timeout from 1s to 5s
2018-09-10 12:32:20 -07:00
Gary Yu
277687c17c Add 2 more dns seeds (#1496) 2018-09-10 12:11:03 -07:00
Antioch Peverell
dbe53f63c8
disable chain compaction on archive nodes (#1498)
* disable chain compaction when in archive mode

* rustfmt
2018-09-10 15:59:42 +01:00
hashmap
da87f5fef4 Don't wait 30 seconds in case of a quick restart (#1488)
Currently on startup we wait for 30 secs if we don't have at least 4 peers with more work. If a node was quickly restarted it is already fully synced so thereare no peers with more work at all. This pr assumes that if we've done some work already and we have enough peers but still 0 with more work we are fully synced and good to go.
2018-09-07 13:01:54 -07:00
Quentin Le Sceller
2e6f7f72b3
Remove unused wallet listener and owner from config (#1483) 2018-09-06 10:34:08 +00:00
jaredbrubaker
54a4bb5b58 Update intro.md (#1482)
Correcting what I think may be a typo.
2018-09-06 07:09:15 +00:00
Yeastplume
974feaf07f
Add chaintype to wallet config (#1480)
* Add chain type to grin-wallet.toml

* rustfmt
2018-09-05 14:37:37 +01:00
Yeastplume
75f0ea6dd3
Save transaction as part of TxLogEntry after transaction completion (#1473)
* save wallet transaction on transaction completion

* rustfmt

* add resend command

* rustfmt

* added unit tests + fixes for grin wallet repost

* add ability to dump transaction file contents

* rustfmt

* wallet doc update
2018-09-05 12:12:29 +01:00
Antioch Peverell
77765796ab
improve "check known" steps during process_block() (#1475)
* document what we do during pipe::apply_block()

* rustfmt

* wip

* rustfmt

* wip

* additional check_known_store and check_known_mmr checks in process_block

* rustfmt

* cleanup coinbase maturity check in process_block

* consolidate the "check in store" logic
add TODOs around the 50 block OldBlock logic

* rustfmt

* cleanup
2018-09-05 10:51:29 +01:00
Ignotus Peverell
86aea875de
Full clang, not only libclang, is required
Fixes #1449
2018-09-04 16:03:49 -07:00
hashmap
1e65467d7d Remove vulnerable smallvec 0.2 from dependencies (#1474)
Reqwest 0.8.7 removed internal dependency on tokio-proto, which removed unsafe small-vec
dependency. It was a build dependency, but still nice to have `cargo audit` output.
2018-09-04 17:26:29 +02:00
John Tromp
c359c8aaf2 one day coinbase maturity (#1457)
* one day coinbase maturity

* make one day maturity a soft fork
2018-09-04 10:59:55 +01:00
Yeastplume
63880f71c7
BIP32 Lib Integration (#1454)
* Test integrating BIP-32 implementation (not complete)

* Test integrating BIP-32 implementation (not complete)

* factor out bip32 crypto functions into trait

* rustfmt

* compliation

* rustfmt

* fixes for test vectors.. all work now with hashes specified in BIP32

* rustfmt

* move reference hasher out of test
2018-09-04 10:58:26 +01:00
Gary Yu
ed73db671f fix for unstable travis-ci test on servers module (#1434)
* fix for unstable travis-ci test on servers module

* skip the PeerWithSelf connection request on sending side

* logs and comments change; and remove an unnecessary unwrap() in test
2018-09-04 10:52:11 +02:00
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