Commit Graph

437 Commits

Author SHA1 Message Date
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
AntiochP 596bbd9b6e add premined pow solution for cuckoo16/UserTesting (#260)
* add premined pow solution for cuckoo16/UserTesting
faster startup time

* only check premined solution on genesis block (height 0)
2017-11-13 10:24:49 -05:00
AntiochP 54dbda6bc2 advanced example wallet needs to point to node api 2017-11-12 13:58:51 -05:00
AntiochP 04eb400422 add "smallest first" strategy for coin selection (#256) 2017-11-10 14:33:36 -05:00
AntiochP 8f33c7e0fe cache key_id->derivation in the keychain (#253) 2017-11-10 10:12:15 -05:00
Yeastplume b831192335 added wallet info/outputs commands with pretty printing (#254)
* added wallet info/outputs commands with pretty printing

* added confirmed but locked to display output
2017-11-10 14:03:31 +00:00
AntiochP 2238495d23 rename JSONPartialTx -> PartialTx (#252) 2017-11-09 15:42:19 -05:00
AntiochP c1656f7660 use the static secp instance everywhere (except the wallet) (#250) 2017-11-09 14:26:45 -05:00
Yeastplume a0c0d6f382 nonmenclature for mining graphs per second (#248) 2017-11-09 15:14:25 +00:00
Yeastplume f978f43fd5 updating cuckoo-miner tag to support cuda 9 and parallel cuda device fixes 2017-11-08 22:02:26 +00:00
Yeastplume 5b47da907f fixing issue where wallet outputs become spent when api server doesn't exist (#242) 2017-11-08 00:44:20 +00:00