Commit graph

2497 commits

Author SHA1 Message Date
AntiochP
c6b94dd2c4
generate locator heights all the way down to 0 by powers of 2 (#378) 2017-11-22 22:59:33 -05:00
AntiochP
348038f0ed Add some randomness to most_work_peer (#364) 2017-11-22 16:07:21 -05:00
Ignotus Peverell
861c54c13b
More explicit panic when syn can't get a peer 2017-11-22 15:54:50 -05:00
Ignotus Peverell
31f8f2ad3e
Better comments for PMMR size check 2017-11-22 15:50:59 -05:00
Ignotus Peverell
5807a6b270
Fix sumtree checks ignoring total size
Duplicate commitment and ducplicate kernel errors, as well as
`is_unspent` did not check the total PMMR size, leading to
wrong detection of duplicates or unspent.
2017-11-22 15:14:42 -05:00
AntiochP
7573f6a556
use read lock over write lock where possible (#363)
fix issue with sync starting twice
2017-11-21 22:28:31 -05:00
Ignotus Peverell
c325c99b87
Error handling fixes sync
And error in the sync run loop would just exit it silently. Abort
with a panic instead.

Peer errors (like disconnect) on locator request was bubling up in
the loop. Just logging instead.
2017-11-21 15:19:17 -05:00
AntiochP
6352dfbac9
add total_diff to ping/pong msgs (#350)
* add total_diff to ping/pong msgs
debug log for total_diff on each ping/pong

* expose peer addr to the handle_payload fn
so we know where it came from

* fix p2p tests for ping

* default to 0 if we cannot read total_difficulty

* updating a connected peer in place

* actually update peer info diff

* fixup p2p tests
2017-11-21 09:24:29 -05:00
Simon B
ce82c82b0d Add doc/table_of_contents.md (#311)
* add doc/table_of_contents, initial attempt, based on https://lists.launchpad.net/mimblewimble/msg00024.html
And explain and link to build.md about creating folders server and wallet manually.
* add Files in this folder (doc)
* rename headlines
* docs: extract code and directory structure to code_structure.md
2017-11-20 19:06:51 -05:00
Yeastplume
c019cc2fd0
miner timing resolution (#351) 2017-11-20 22:57:36 +00:00
AntiochP
2f09d2e630
rollback the change output in the wallet on tx failure (#345) 2017-11-20 14:12:52 -05:00
AntiochP
00d82f2c04 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-11-20 12:35:52 -05:00
Michalis Kargakis
1f0808fc24 Markdown fixes + gitignore addition (#334)
* Markdown fixes in doc/build.md

Signed-off-by: Michalis Kargakis <mkargaki@redhat.com>

* Ignore grin.log and wallet.seed
2017-11-20 14:33:35 +00:00
Yeastplume
6ad403fbf8
Wallet recovery return unspent only (#340)
* beginning to add wallet restore... api endpoints and basic restore

* basic restore working, still missing features

* rustfmt

* large speed up to output search, should be more or less working

* properly mark coinbase status

* ensure only unspent utxos are returned from sumtree
2017-11-20 10:38:49 +00:00
Simon B
e20975136e
less chatty Testnet1 outputs (#316)
Fixes #281 by doing:

- "Starting validation pipeline for " -> "Processing "
- stdout logging default = Warning
- ERR -> INFO for "Transaction rejected: Already in pool" -- only for netadapter transaction_received, which (hopefully!) only gets tx from peers, and lots of those will be duplicates, that's good and not an error.

* Downgrade ERR even down to DEBUG.

Also let Transaction rejected show tx hash,
 so users can check if such a rejection is for the
 payment they expected, or just any random peer
 sending in some old and already known tx.
2017-11-19 20:45:32 -05:00
Ignotus Peverell
8ce494536e
Regularly ping all peers to check liveness
Ping all our peers every 20 sec. If no pong occurs within a
reasonable time (5 sec), disconnects.
2017-11-19 20:40:49 -05:00
Ignotus Peverell
c1be4e2113
Debug log for block broadcast 2017-11-19 20:40:36 -05:00
Simon B
fed0bd3ed3 [CONSENSUS] Limit number of inputs in a block #261 (#328)
* Limit number of inputs in a block, fix #261
* MAX_BLOCK_INPUTS = 300_000 // IO-time bound DoS protection. 5MB/s disk random reads gives ~150k UTXO lookups/s, so set limit at 300k UTXO inputs
2017-11-19 19:59:07 -05:00
Yeastplume
4b3a374d98
Wallet Restore feature (#338)
* beginning to add wallet restore... api endpoints and basic restore

* basic restore working, still missing features

* rustfmt

* large speed up to output search, should be more or less working

* properly mark coinbase status
2017-11-20 00:50:09 +00:00
Simon B
7986829d58 Quick placeholder api route index (#286) (#324)
* Aiming for #286 - quick placeholder to have at least something to help your memory

* corrections:pool/push get->post, add sumtrees/(roots|lastutxos|lastrangeproofs|lastkernels)
2017-11-19 15:24:14 -05:00
Simon B
08a277f8d1 Log "nn.nnn coins spent using strategy ..." on log level Debug (#326)
* Log "nn.nnn coins spent using strategy ..." on log level Debug
* util::logger whitespace/cleanup
Add code comment about LOGGING_CONFIG injection
2017-11-19 13:34:43 -05:00
Andrew Bellenie
2d1ed9ba52
Fix for issue #318 (#323)
* Rename wallet 'receive' to 'listen'
* Handle use of previous 'receive' command gracefully and clarify docs
2017-11-19 01:55:26 -05:00
Ignotus Peverell
caee282fcc
Better logging in case of tree root setting error 2017-11-18 14:31:29 -05:00
Ignotus Peverell
addaadf711
Better panic message in sync in case of no peers. 2017-11-18 13:54:44 -05:00
AntiochP
256283966a
Allowable write size as u64 instead of usize. Fix #303. 2017-11-18 13:43:57 -05:00
AntiochP
2645b9ffba Eliminate gap between generating next key in wallet and saving output for this key (#302) 2017-11-18 02:31:02 -05:00
AntiochP
90012c86ac
use a short timeout when opening the connection to possible peers (#300)
* use a short timeout when opening the connection to possible peers
lots of peers in the db are unavailable and we do not want to wait 60s for these

* also randomize peers so we don't always try and connect to peers with low ip addresses

* bump timeout up to 5s for peering
2017-11-17 20:13:49 -05:00
Andrew Bellenie
2e87f40b91 Add note about memory requirements to build docs (#301) 2017-11-17 19:42:21 -05:00
Simon B
c426d79ecc FAQ, first attempt (condensed from gitter chat) (#298) 2017-11-17 19:12:55 -05:00
Yeastplume
45ee34d113 Wallet doesn't update local status until getting a 200 from receiver (#299) 2017-11-17 18:33:16 -05:00
AntiochP
2a92eab675 Spawn connect_and_req calls (#296)
Avoids delays in connecting with long timeouts stalling the node.
2017-11-17 15:17:14 -05:00
Ignotus Peverell
bb7a61d284
Return error when peer_addr() fails on connection
Likely issue is the connection failed right after being
established, leading `peer_addr()` to fail and the `unwrap()`
crashes the process instead of failing gracefully. Fix #293.
2017-11-17 14:28:26 -05:00
Carl Dong
efb41596b2 Daemonize server with proper working directory. (#289) 2017-11-17 11:55:49 +00:00
windsok
10380c0ce0 Update build.md (#284)
* Add required minimum version for Rust (Build fails on Ubuntu 16.04 LTS with 1.17.0, but works fine with a manual install of 1.21.0, so I am assuming that 1.21.0 is the minimum)
* Make it clearer that grin.toml needs to be copied into the server directory
2017-11-16 23:18:45 -05:00
Ignotus Peverell
fec8858ead
Ported acbe983 and 58d7dc7 from testnet1 branch 2017-11-16 18:17:56 -05:00
Yeastplume
341269d95f
Testnet doc (#278)
* attempt to continue if duplicate coinbase commit is found

* updating docs for testnet
2017-11-16 19:58:41 +00:00
Ignotus Peverell
35d99efc96
Default p2p port to 0.0.0.0 2017-11-16 14:47:38 -05:00
Ignotus Peverell
97d7a43ccf
Default value for ChainType, when not in grin.toml 2017-11-15 17:30:48 -05:00
Ignotus Peverell
91fdaa8320
Genesis block for known chains, mine dev chains (#269)
Renamed mining parameter mode to chain type, with existing types
of CI testing, user testing, testnet1 or mainnet. The public
chains (testnet1 and mainnet) come with their fully pre-defined
genesis block.

Still need to set the nonce and cycle for testnet1 genesis.
2017-11-15 16:49:15 -05:00
AntiochP
6fb085a823 Fix bad case of trying to rewind to block at height 0 (#271)
* bad case of trying to rewind to block header height 0
* rewind_to_genesis appears to work
* do not assume genesis block at height 0 is empty, pass full block in to rewind, check for last output and kernel, use index 0 if block is empty
2017-11-15 15:37:40 -05:00
AntiochP
f663340628
pass in max_transactions to wallet send/burn from grin.rs (#272) 2017-11-15 13:56:35 -05:00
AntiochP
9f7e047aeb
first block is 1 confirmation (#270) 2017-11-15 08:46:32 -05:00
AntiochP
f4e7941213
fix default wallet strategy (all vs default) (#267) 2017-11-14 22:30:22 -05:00
Ignotus Peverell
6ac2fe2a8c
Major fee bump to come to more reasonable values
Starting on the higher side for testnet to see how it goes in
practice. Introduced constants for each smaller unit.
2017-11-14 20:14:07 -05:00
Yeastplume
89217a1fa5 Attempt to continue if duplicate coinbase commit is found (#266) 2017-11-14 18:58:39 -05:00
AntiochP
8269bdd873 Rework wallet coin selection to select a max of 500 outputs (#265) 2017-11-14 18:54:28 -05:00
AntiochP
c2a95637b3 more robust peer handling (#244)
* use HashMap internally for tracking connected peers (to avoid duplicates)
* reuse the handshake on the server so we can track our own nonce to avoid self connections correctly
* make sure we start up the clean_peers loop even in seedless mode
* logging in monitoring peers loop
* simplify monitoring for no seeds
* fixup and cleanup simulnet tests (real seeds in places)
* only start the sync if we have either seeds or peers that we know about, exit syncer safely if we have no connected peers
2017-11-14 13:57:16 -05:00
Yeastplume
855602e98a
add flag to show spent outputs in wallet output command (#263) 2017-11-14 16:13:58 +00:00
Daniel Tsui
d7fd730153 Correct dir name in advanced example+fix typo (#262)
This PR clarifies the directory name in the advanced example of `build.md`, and fixes a minor typo.
2017-11-13 20:27:53 -05:00
AntiochP
10a1ddf5e8 Use consensus rule that minimum difficulty is 10 (#251) 2017-11-13 19:45:10 -05:00