Commit Graph

247 Commits

Author SHA1 Message Date
Antioch Peverell bc6342ea65 Fix issue where we have no metadata for a block (#938)
when restarting node before initial sync completed
2018-04-06 17:14:50 +00:00
Quentin Le Sceller b9de134209 Full sync ask blocks only from other archival nodes (#930)
* Request body_sync only from archival node
* Move verification to p2p crate
* Additionnal check on capabilities
* Add check block 1
2018-04-06 03:06:34 +00:00
Simon B 98efaf88df mixed small stuff (#934)
* documentation and spelling
* unused values in tests; just .unwrap()
* unneeded macro_use (router)
* unneeded macro_use and use-imports
* unused value -> .unwrap
* unused variables
* clarify that " is required (see https://github.com/mimblewimble/grin/commit/107ea3c4dd5e75b64283a01d83a1f4a2816fa31c)
* first steps to dig into #933 test_p2p issues
* less simulnet build warnings
2018-04-05 23:31:34 +00:00
Ignotus Peverell c460f9876a Improvements to orphan handling to help sync (#931)
Our chain orphans data structure now does:

* Eviction based on a max total number of orphaned blocks
* Evicts further away first, then too old
* Avoids all cloning (blocks can be big)

This allows sync to be a little more stupid, only reducing the
number of blocks it requests when orphans get nearly full.

Fixes #897
2018-04-05 03:24:43 +00:00
Quentin Le Sceller 68e2fa3915 Randomize Dandelion timer (#928) 2018-04-04 17:14:58 +00:00
hashmap ac979d021d Build index header by height after fast sync (#925)
Make sure that all headers are indexed
2018-04-04 04:45:45 +00:00
Ignotus Peverell 85ee5041aa Sync improvements (#923)
* Added additional message type size limits
* Externalize sync loop state, check if we received all
* Adjusted some message sizes, log error when too short
* 4x limits to give ourselves more space
* No need for sync to wait if we have enough peers.
* Tolerate a few less headers before considering we got them all.
2018-04-03 20:21:13 +00:00
hashmap 923adf0fe5 Fix header_by_height (#922)
Currently for fast sync index header_by_height is created only for headers above the horizon
2018-04-02 23:10:30 +00:00
yeastplume 959b1d3e8d difficulty check error fix 2018-04-02 10:44:38 +01:00
Ignotus Peverell 3d2796bdd6 Minor log cleanup 2018-03-30 18:22:01 +01:00
Ignotus Peverell cb0e0c4863 Merge branch 'master' of github.com:mimblewimble/grin 2018-03-30 18:09:22 +01:00
Yeastplume 50856b4cce average over last 59 blocks (#917) 2018-03-30 11:50:29 +01:00
Ignotus Peverell 5ba0dbf38d Fix and cleanup of fast sync triggering logic (#916)
* Fix and cleanup of fast sync triggering logic
* New txhashset on fast sync has to be applied, not rolled back
* Do not block if peer send buffer is full, fixes #912
2018-03-30 06:02:40 +00:00
Ignotus Peverell 107ea3c4dd Disable every-block full state validation
We can re-enable it on some nodes to keep an eye on the network,
but for debug builds this is too expensive. It can take over 60
sec for low-end environments, causing them to never catch up.

I think this is still better than the alternative of telling
everyone to run release builds.
2018-03-29 18:29:25 +01:00
Simon B 3e3fe6cae6 Testnet2 small fixes (#899)
* add hint for gcc-5 for building CUDA plugin
* add N_BLOCks comment for >=6GB GPU cards
* minor logging cleanup
* mark to be kept + reformat as "@ height [hash]"
* show CuckooNN + better wording
2018-03-29 15:56:46 +00:00
Yeastplume ea9a978c87 Tui update 1 (#911)
* minor low-hanging TUI updates

* rustfmt

* make diff/height output clearer
2018-03-29 12:29:17 +01:00
Ignotus Peverell bfb3505183 Fix strict time progression in miner 2018-03-28 07:21:07 +01:00
Antioch Peverell 696097370e do not save header during header first sync (#891)
just use the header as a hint to go request the block
2018-03-27 16:48:09 -04:00
Ignotus Peverell 09a4c454fa Header check before asking previous on orphan not needed. Fast sync now properly keeps the syncing flag on. 2018-03-27 19:56:35 +01:00
Yeastplume 28985bad55 Make peer parameters user-configurable (#883)
* make peer parameters user-configurable
* rename peer_preferred_count to peer_min_preferred_count
2018-03-27 17:17:01 +00:00
Yeastplume e8e013195f Make peer connect attempts asynchronous (#879) 2018-03-27 16:11:09 +00:00
hashmap 99804a6485 Change log level for found cuckoo solution event (#881)
Trace seems to be to low, there is a  user request to make it more visible
https://gitter.im/grin_community/Lobby?at=5aba24967c3a01610d7c211f
2018-03-27 13:51:42 +01:00
Ignotus Peverell 77e63f3e3f Fix for async miner loop not resetting head (#877) 2018-03-27 09:22:11 +01:00
Quentin Le Sceller b9b6954d02 Automatic version with cargo.toml (#874)
* Automatic version with cargo.toml

* Add more time for server to start
2018-03-26 17:21:03 -04:00
Yeastplume b38c6b1cf1 change default to web seeding (#871) 2018-03-26 16:11:47 +01:00
Yeastplume 6f264b2f7e Testnet2 test fixes (#870)
* use dev genesis for automated tests

* never test block time on automated tests

* automated genesis block creation
2018-03-26 12:07:04 +01:00
Ignotus Peverell 327293d28e Genesis, version changes and doc for testnet2 (#865)
* Bump up crates versions

* Finally add a Cargo.lock to avoid dependency breakages

* Build doc update for testnet2

* Fix test framework not really using its mining config

* Testnet2 genesis, best so far at 128 difficulty (a nice number)

* Minor build doc update
2018-03-26 10:48:46 +01:00
Quentin Le Sceller 3ae7b0dedf Attempt to fix api test (#868)
Now wait 1 second for the wallet to start.
2018-03-26 03:32:15 +00:00
Ignotus Peverell f72b36116e Somehow, all wallets tests are failing progressively. Hoping @quentinlesceller can take a look, commenting out for now. 2018-03-26 03:58:15 +01:00
Simon B 9285de2c24 Here is a case where ~ is needed, to allow cargo update to only touch the patch level version (third number). Anything else than ~ means that both first numbers can be raised, so "2.1" updaates to "2.2" (#866) 2018-03-25 20:08:38 +00:00
Ignotus Peverell 2bf656646c Force slog version to 2.1 (2.2 broke some traits) 2018-03-25 19:54:41 +01:00
Simon B f9b87164e7 Idiomatic cargo toml (#862)
* Specify versions SemVer-style
 - slog and serde
* Comments for not update-able pre-1.0 crates:
 - urlencoded at "0.5" since 0.6+ lacks trait `plugin::Plugin<iron::Request<'_, '_>>`
* alpha-sort deps
* Specify versions SemVer-style
 - backtrace, bitflags, blake2-rfc, bodyparser, built, byteorder
 - chrono, clap, demonize, enum_primitive, env_logger
 - failure, failure_derive, futures
 - hyper, iron, itertools, lazy_static, libc
 - memmap, mount, net2, num_bigint, prettytable-rs
 - rand, regex, rocksdb, router, siphasher
 - term, time, tokio-core, tokio-retry, urlencoded, uuid, walkdir, zip
2018-03-25 17:44:27 +00:00
Simon B a8fc82d8c1 Console debug fixes (#861)
* move some debug! to trace!

* more informative debugs

* standardising on always showing chain tips as "cumulative difficulty @ height [hash]"

* make 2 debug outputs into a single

* "no peers" as warning (not info) to let it stand out more clearly

* move fn param (used only in this one debug line)

* clarify difficulty "units"
2018-03-25 12:41:12 -04:00
Ignotus Peverell 035f60dfb4 Commenting out wallet test until someone fixes it 2018-03-23 17:50:55 +00:00
Yeastplume 80887196a8 Restore wallet restore (#843)
* adding appropriate message to bulletproofs to allow for restore

* rustfmt

* should work, now test

* rustfmt

* fix to wallet restore, works now

* fix pool tests

* fix pool tests

* rustfmt
2018-03-23 10:13:57 +00:00
Ignotus Peverell c6761f0b18 Fix adapter compile error 2018-03-22 22:58:32 +00:00
Quentin Le Sceller 836391cc53 Dandelion relay update (#825)
* Change error logger to debug logger
* Dandelion relay update after monitor peers
* Typo + kick off Travis build
2018-03-22 22:51:09 +00:00
Antioch Peverell 155bab93a4 We only want to run chain validation in some scenarios (#842) 2018-03-22 22:44:32 +00:00
Ignotus Peverell 3dd627384a Test cleanup 2018-03-22 22:04:22 +00:00
Ignotus Peverell 9e10943374 Fix wallet port format in grin.toml 2018-03-22 19:28:25 +00:00
Ignotus Peverell ee678b28d0 Remove unnecessary height check in sync. (think it was only there for tests) 2018-03-22 19:26:29 +00:00
Ignotus Peverell 9beb66a75e Don't run full validation on genesis 2018-03-22 19:25:36 +00:00
Antioch Peverell 4b639cae5c Quieten txhashset logging (#846)
* suppress the log msg until we start fast sync, we need to be past the horizon before we do this
2018-03-22 16:52:40 +00:00
Quentin Le Sceller 675faec05d Change wallet api_listen_port format (#815)
* Change wallet api_listen_port format
* Fix tests
2018-03-22 16:49:27 +00:00
Antioch Peverell ff4d68d2be config to enable full chain validation per block (#839)
* default to full chain validation on processing each block (except during sync)
* add sample config for chain_validation_mode
* document chain_validation_mode
2018-03-21 20:50:08 +00:00
Simon B e3601b6c8e Travis cleaner caching (#833)
* speed up Travis startup
- keep all test tempdata in target/tmp
- purge before saving target/* to S3 cache

* allow 4 minutes for cache up/download from Travis' S3 cache stores
2018-03-21 16:05:07 +00:00
Ignotus Peverell f0a3479ea3 Sync flag fix (#830)
Sets the sync flag properly when changing to txhashset download
mode to fast-sync to full state. Fixes #827.
2018-03-21 03:06:01 +00:00
Simon B 4fa9ccc4f7 Cargo.toml (#818)
* Make sure no grin crates get published by mistake: https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish--field-optional
* add missing workspace = '..', [workspace docs for interested readers](https://doc.rust-lang.org/cargo/reference/manifest.html#the-workspace-section)
* dev- or dev_ works equally well, but dev- is what's typically used
* authors = Grin Developers <maillist>
* [dependencies] keep grin-* at the end + readability
2018-03-20 18:21:29 +00:00
Ignotus Peverell 22106693f3 Still need to check if syncing before asking for orphan parent 2018-03-20 17:50:05 +00:00
Quentin Le Sceller fcfe7bc6a4 Basic Dandelion transaction routing (#719)
* Initial Dandelion Commit
* Changed stem_tx_pool to tx_stempool
* Introduction of stem memory pool and stem pool config
* Pool push now send to stem memory pool
* Add stem transaction functions
* Add stem transaction pool
* Drastically simplified code structure
* Add monitor transactions
* Add Dandelion monitor and remove transactions from stempool
* Add peer relay monitor
* Reconcile block with stempool
* Fix total size bug
* Add fluff option for pool push
* Added details on dandelion monitor
* Fix issue with missing parent
* Child transaction with stempool parent are now forced stem
* Update Dandelion Relay from outgoing peers
* Fix missing pool reconciliation
* Add the ability to fluff a transaction directly
* Fix tests for Dandelion
* Missing send_stem_transaction method...
* Add fluff handler for wallet
* Add logger when successfully updated Dandelion relay
* Launch transaction monitor last
* Fix dandelion relay misplaced
* Add logging and updating for stempool
* Additionnal check for stem transaction
* Fix 2 Locks in a row
2018-03-20 03:18:54 +00:00