Commit graph

1047 commits

Author SHA1 Message Date
Yeastplume
4c6a193e01
[WIP] Miner removal (#979)
* Beginning to remove in-process miner

* rustfmt

* rustfmt

* rustfmt

* rustfmt

* remove pow crate and put remnants into core

* rustfmt

* fix test compilation in core and chain

* rustfmt

* Updating server tests to use test miner

* rustfmt

* rustfmt

* remove pow from test matrix

* adding basic stratum stats to TUI

* run stratum server at all times, and halt messages while syncing

* fix core tests

* add ability to run internal test miner for cuckoo 16 testing

* modify build instructions
2018-04-24 09:18:24 +01:00
Antioch Peverell
46a7245ec1 Cleanup unused fn on rm_log (#999) 2018-04-24 00:46:06 +00:00
Antioch Peverell
ef304ee9c1
add block header cache to store (#996)
* WIP - add blocks header cache to store
The DifficultyIter is expensive to use when validating block headers.

* lru_cache

* rustfmt

* cleanup
2018-04-23 14:55:25 -04:00
Antioch Peverell
7cc4fdfed9
simplify request_headers and use less read locks on peers (#995) 2018-04-23 11:54:16 -04:00
Blade Doyle
86d7628562 add request method name to the result to allow matching onthe client side (#987)
* add request method name to the result to allow matching onthe client side

* update tests for change in rpc response api
2018-04-23 09:41:35 +01:00
Antioch Peverell
03fa9f491d
we were generating different genesis blocks (#994)
every time a user testing node started up
and we could not peer them successfully
2018-04-22 08:42:48 -04:00
Dawid Ciężarkiewicz
b803bdc9aa Make pre-commit more portable (#993)
Right now it fails on NixOS
2018-04-22 08:33:58 -04:00
Antioch Peverell
ced6e647b8
still do not fully understand what PhantomData is *for* exactly (#991)
but standardized naming and usage to match https://doc.rust-lang.org/beta/nomicon/phantom-data.html
so at least it looks similar to the official docs
2018-04-21 17:03:45 -04:00
Antioch Peverell
77172057ff
header sync does not touch txhashset so no need to take a write lock on it (#990) 2018-04-21 15:15:01 -04:00
Antioch Peverell
242b67182c
use less cloning when validating a txhashset (#989) 2018-04-21 14:14:43 -04:00
Antioch Peverell
c36e72d8c9
fix off by one in setup_height (#988) 2018-04-20 21:11:41 -04:00
Antioch Peverell
f0cf903adc
fix various issues with rewinding data file (#983)
* fix issue with rewinding data file
also fix fragility around an empty MMR (and the memory map)

* cleanup
2018-04-19 19:52:46 +01:00
Antioch Peverell
b7e29fee55
introduce some minimal sync state (#978)
* commit

* rustfmt

* only fast sync once
then treat as full sync

* commit

* add some debug logging so we can track progress when verifying rangeproofs

* rustfmt
2018-04-18 20:12:39 +01:00
Ziyuan Liu
a8cc58bb89 Remove oddfee error references + validation check (#975) 2018-04-18 12:21:21 +01:00
Antioch Peverell
891382653d
we may receive a block (header) with no previous header (#972)
as we have not yet sync'd to that point
this is valid and not an error
2018-04-18 01:52:07 +01:00
Antioch Peverell
2503811e89
init_head and not reset_head on startup (#971)
so we do not reset the sync_head if we restart during a sync
2018-04-18 01:41:51 +01:00
Quentin Le Sceller
bd64c6099f Add aggregate function for multi-kernel transaction (#966)
* Add aggregate function

* Rustfmt

* Add multikernel tx test

* Rustfmt

* Add test bad multi-kernel transaction

* Add sorting

* Modified multikernel test
2018-04-17 21:40:51 +01:00
hashmap
7bad33d249 Merkle proofs fee (#898)
* Refactoring before new functionality

* Simplify and use just count of proofs
2018-04-17 18:09:29 +01:00
Yeastplume
07c2358562
add height to stratum job (#969) 2018-04-17 16:17:30 +01:00
Blade Doyle
323480a771 minor code reorg, add mining job difficulty, enhance miner status response (#967) 2018-04-17 09:16:58 +01:00
Quentin Le Sceller
cc9ffcc1ab Remove unused imports (#965) 2018-04-16 21:18:28 +00:00
hashmap
b28de95da4 Error handling using failure in API (#949)
This PR adresses #166
Error handling in wallet was ported to failure in https://github.com/mimblewimble/grin/pull/713
Using the same error model makes wallet code simpler and may simplify migration to Hyper.
2018-04-16 10:00:32 +01:00
chri2
ffa5bfe16f Update build.md (#960) 2018-04-16 09:58:50 +01:00
Blade Doyle
e13c22356a enhance test by validating against stats (#959) 2018-04-16 09:58:19 +01:00
yeastplume
a3c606d303 text config fix 2018-04-13 15:25:05 +01:00
Yeastplume
ac8ba4bd4a
Stratum config tweak (#958)
* don't require stratum server config

* don't require stratum server config
2018-04-13 14:58:25 +01:00
Blade Doyle
bcc8f68f52 minimal stratum server (#937)
* Fix issue where we have no metadata for a block (#938)

when restarting node before initial sync completed

* Avoid double-locking on add eviction. Fixes #936

* Fix 33c5a983

* Add support for DNS Seed (#940)

* Add support for DNS Seed
* Add port
* Add seed.grin-tech.org
* Remove duplicate IPs

* minimal stratum server

* Modifications for review comments.  Move stratum test into its own file, move get_block() into its own rust module, use pool and chain only rather than the entire Miner object

* rustfmt

* cleanup

* cleanup

* Introduce extending_readonly to simplify a forcing and cancelling rollbacks (#945)

readonly views of the txhashset

* Add DNS Seed and make DNSSeed default (#942)

* Add dns seed seeding type
* Add grin-seed.owncrypto.de and make DNSSeed default
* Add email address for each DNS Seed

* [WIP] Core PMMR and API updates to support wallet restore (#950)

* update pmmr to get batch of elements by insertion position

* update pmmr to get batch of elements by insertion position

* add api + chain calls to get traversed outputs back out

* add api + chain calls to get traversed outputs back out

* first pass getting wallet restore to work again with updated utxo-walking api

* Update simulation.md

* Fix Bus Error (core dumped) when validating fast sync txhashset (#956)

This PR fixes #953 by introducing a lock for txhashet_write. It's not enough
to synchronize access to in memory data, files also needs to be protected, so
a general txhashset lock was introduced.

* refactor grin crate into separate modules (#955)

* Add total kernel offset to block api (#954)

* minimal stratum server

* Modifications for review comments.  Move stratum test into its own file, move get_block() into its own rust module, use pool and chain only rather than the entire Miner object

* rustfmt

* cleanup

* cleanup

* Merge with grin_grin -> servers code reorg

* Merge with grin_grin -> servers code reorg

* add stratum server stats
2018-04-13 14:42:25 +01:00
jaspervdm
8f3fbe632f Add total kernel offset to block api (#954) 2018-04-12 18:09:03 +00:00
Yeastplume
1c5aee68bf
refactor grin crate into separate modules (#955) 2018-04-12 10:11:24 +01:00
hashmap
8e26d4dbac Fix Bus Error (core dumped) when validating fast sync txhashset (#956)
This PR fixes #953 by introducing a lock for txhashet_write. It's not enough
to synchronize access to in memory data, files also needs to be protected, so
a general txhashset lock was introduced.
2018-04-12 10:10:11 +01:00
Quentin Le Sceller
cbfd3803bf
Update simulation.md 2018-04-11 11:26:25 -04:00
Yeastplume
dcdf654bc9
[WIP] Core PMMR and API updates to support wallet restore (#950)
* update pmmr to get batch of elements by insertion position

* update pmmr to get batch of elements by insertion position

* add api + chain calls to get traversed outputs back out

* add api + chain calls to get traversed outputs back out

* first pass getting wallet restore to work again with updated utxo-walking api
2018-04-11 10:02:07 +01:00
Quentin Le Sceller
cf2ffbc11a Add DNS Seed and make DNSSeed default (#942)
* Add dns seed seeding type
* Add grin-seed.owncrypto.de and make DNSSeed default
* Add email address for each DNS Seed
2018-04-10 19:29:55 +00:00
Antioch Peverell
4d6e0378fe Introduce extending_readonly to simplify a forcing and cancelling rollbacks (#945)
readonly views of the txhashset
2018-04-09 16:37:46 +00:00
Quentin Le Sceller
cb221ee102 Add support for DNS Seed (#940)
* Add support for DNS Seed
* Add port
* Add seed.grin-tech.org
* Remove duplicate IPs
2018-04-07 03:48:42 +00:00
Ignotus Peverell
65d5bd40e3
Fix 33c5a983 2018-04-06 19:03:57 +01:00
Ignotus Peverell
33c5a9835a
Avoid double-locking on add eviction. Fixes #936 2018-04-06 18:46:07 +01:00
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 107ea3c4dd)
* first steps to dig into #933 test_p2p issues
* less simulnet build warnings
2018-04-05 23:31:34 +00:00
Antioch Peverell
6ceed79c03 Use hashable_ord on short_ids (#932) 2018-04-05 15:48:30 +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
Ignotus Peverell
f247bda834
async mode by default 2018-04-04 22:01:49 +01:00
Quentin Le Sceller
68e2fa3915 Randomize Dandelion timer (#928) 2018-04-04 17:14:58 +00:00
Riccardo Casatta
40212942da use std lib function in pmmr for all_ones() and most_significant_pos() (#924)
* use std lib function in pmmr for all_ones() and most_significant_pos()

* fix all_ones() edge case with 0 and add comparison tests with old functions
2018-04-04 13:25:03 +01: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
Ignotus Peverell
0596b753a0
Added @tromp's idea of a server-facilitated interaction 2018-04-03 21:15:12 +01:00
Ignotus Peverell
c7cc91a8ea
First pass at wallet design doc 2018-04-03 20:14:01 +01: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