Commit graph

877 commits

Author SHA1 Message Date
hashmap
3026429b05 Do not wrap transactions into Box in pool (#1069)
It makes code more complex and may require more memory allocations than needed.
2018-05-16 00:21:33 +01:00
Ignotus Peverell
54b06a6fcb
Minor code structure doc fixes 2018-05-13 20:02:25 +01:00
Antioch Peverell
0d9242e5dc
refactor on master, pass in offset as blinding_factor (#1064) 2018-05-13 13:59:27 -04:00
Ignotus Peverell
ce1dca1b68
Ask for txhashet before horizon to account for fast sync time
We test if we're in fast sync or not by checking if our head is
more recent than horizon. However, by the time we get the data and
validate, more blocks have passed, and we'd be after horizon again.
So we request the txhashset for a more recent block than the one
at horizon.

The current value was 20, leaving only 20 min of slack, which isn't
enough for debug builds and isn't future-proof. Change to use
`0.9*horizon`, leaving about 2.5 hours.
2018-05-12 21:31:22 +01:00
Ignotus Peverell
9909e8e2ff
Release builds 2018-05-12 20:24:23 +01:00
Ignotus Peverell
d3a33c790e
Automatically trigger compaction every 2000 blocks (#1054)
Does so in a separate thread as it can take some time. Also
remove validation pre-compaction as it's hopefully unecessary
now.
2018-05-11 17:58:52 +01:00
Yeastplume
4121ea1240
Wallet+Keychain refactoring (#1035)
* beginning to refactor keychain into wallet lib

* rustfmt

* more refactor of aggsig lib, simplify aggsig context manager, hold instance statically for now

* clean some warnings

* clean some warnings

* fix wallet send test a bit

* fix core tests, move wallet dependent tests into integration tests

* repair chain tests

* refactor/fix pool tests

* fix wallet tests, moved from keychain

* add wallet tests
2018-05-09 10:15:58 +01:00
Blade Doyle
982fdea636 Enhance login and submit logging (#1055)
* Enhance login handler to support parameters.  Also report worker login string when reporting found blocks

* report worker id if no login
2018-05-09 10:10:47 +01:00
Quentin Le Sceller
dd861c8d8c Update Dandelion simulation doc (#1034) 2018-05-08 21:57:22 +01:00
Ignotus Peverell
4e531435e0
Buffers writes in the MMR store types (#1050)
Adds a `BufWrite` around each file that gets incrementally written
to in the MMR store main types. Should speed up a few operations
quite a bit, but particularly flushing the remove log. Saving
txhashsets on new blocks is now 10x to 20x faster, making full
block syncs a lot faster.
2018-05-08 21:54:36 +01:00
duub qnnp
8e57c40851 update a successful build results (#1051)
remove the mining folder of the expected results list
2018-05-08 21:48:56 +01:00
Casey Rodarmor
9a8a0479d0 [bin/grin] Make peer IP/port mandatory for ban/unban commands (#1042)
By default, clap args are optional. Make them required, since otherwise the
commands can't do anything.
2018-05-08 10:27:04 -04:00
Antioch Peverell
f90506d869
txhashset extension now implements Committed (#1049)
* txhashset now implements committed for consistency

* rustfmt and cleanup
2018-05-08 10:23:33 -04:00
Casey Rodarmor
ad6e7814de Add a .editorconfig file
The only setting of note is to use hard tabs in rust source files.
2018-05-07 10:08:55 -04:00
Antioch Peverell
4dd94ff39e
[testnet2] Store output sum (#1043)
* block sums and reworked block validation
read and write block_sums
refactor validate on both block and txhashset
write block_sum on fast sync
we store the kernel_sum (need to account for the offset)

* block_sums

* rustfmt

* cleanup
2018-05-07 09:21:41 -04:00
Casey Rodarmor
b42b2a4f77 Fix comment in test_p2p() (#1041) 2018-05-06 21:02:45 -04:00
Casey Rodarmor
a481c6d495 Add comments to get rid of missing_docs warnings (#1032) 2018-05-03 08:57:35 -04:00
Casey Rodarmor
bc3b8b1664 Add spaces between methods in Peers ChainAdaptor (#1025)
Aside from being a bit easier to parse, it helps vim users
navigate using the `{` and `}` motions
2018-05-01 21:39:22 -04:00
Quentin Le Sceller
9ecad86d43
Fix typo in simulation.md (#1022) 2018-05-01 14:18:51 -04:00
Quentin Le Sceller
aa984ed550
Handle locked funds (#1016)
* Handle locked coins
2018-05-01 09:49:00 -04:00
Blade Doyle
9f890643b9 issue 1017 - only generate blocks when there are workers (#1018) 2018-05-01 09:29:39 +01:00
Quentin Le Sceller
f8732d7621
Prioritize and allow no change transaction (#1009)
Prioritize and allow no change transaction
2018-04-27 10:26:40 -04:00
Yeastplume
93b648fbc0
Split wallet server queries into multiple queries + restore performance (#1013)
* mods to speed up restore a bit

* mods to speed up restore a bit

* performance improvements to wallet restore and split large server queries into multiple
2018-04-27 14:16:30 +01:00
Yeastplume
59664181e4
update wallet restore, generate new merkle proof for coinbase outputs (#1008) 2018-04-26 14:01:01 +01:00
Yeastplume
820d55a532
Change wallet retry strategy (and address stratum panic) (#1004)
* remove complex retry from wallet client

* remove complex retry from wallet client

* move retry code to stratum
2018-04-25 16:48:19 +01:00
Severus Sneep
8227ce941a Use a lock-directory- instead of a lock-file- and backup prev wallet.dat. (#982)
It looks like lockfile implementation did still suffer from a race
condition. Only when creating the file with O_EXCL, file creation fails
if the file does already exist. One could use O_EXCL, but Windows
might use another flag to achieve the same. Moreover, O_EXCL doesn't
work as expected if the files are accessed over NFS.
In contrast, mkdir() is atomic in every of the mentioned cases.
Aside from using a lockdirectory, this patch also backups the current
wallet.dat contents to wallet.bck in case writing a possibly hefty
amount of JSON to the new wallet.dat fails. It is hoped that at least
one of the .bck and .dat files has usable contents in case failure.
2018-04-24 20:03:01 +00:00
Antioch Peverell
e22d025dc8 Simplify block marker metadata (#985)
* wip BlockMarker struct, get rid of PMMRMetadata
* use rewind to init the txhashet correctly on startup, we do not need to track pos via metadata (we have block markers), we do not need to open the txhashset with specific pos (we have rewind)
* better logging on init
* keep rewinding and validating on init, to find a good block
* use validate_roots on chain init
2018-04-24 19:53:01 +00:00
Quentin Le Sceller
55f6e3e63f
Anti-aggregation mechanism for multi-kernel transaction (#984)
* Test multi kernel deaggregation

* Add aggregate without cut_through and deaggregate function

* Add deaggregate function in pool and test

* Rustfmt

* Add deaggregate_and_add_to_memory_pool

* Deaggregate regular multi kernel transaction by default

* Rustfmt

* Add error type faileddeaggregation

* Add find candidates function

* Rustfmt

* Use intersection of sets instead of for comparisons

* Rustfmt

* Removed unnecessary if

* Stricter verification with is_subset

* Rustfmt
2018-04-24 15:47:13 -04:00
Dawid Ciężarkiewicz
2b2e13be63 Optimize logging (#992)
`Async<Discard>` means "drain that will send each logging
record to an async thread, that will discard it". This means
logging record is sent to another thread for no reason.
2018-04-24 11:02:49 +01:00
yeastplume
5bc9e29974 restore sensible defaults 2018-04-24 10:54:06 +01:00
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