Commit graph

937 commits

Author SHA1 Message Date
Ignotus Peverell
ff5d651b6f
Wallet checker cleanup, remove old unconfirmed outputs (#1084)
Use the standard Rust `chunks` function instead of hand coded
cursors. Add a cleanup function to get rid of old unconfirmed
outputs.
2018-05-24 01:14:34 +01:00
Ignotus Peverell
3525df1bf1
Coinbase key reuse (#1081)
Reuse unused coinbase key in stratum server. Instead of asking a new key id from the wallet every time, the stratum server now provides the older one again if it hasn't been used (the local node didn't end up mining a block).
2018-05-23 19:32:38 +01:00
Ignotus Peverell
257b6bf05a
Minor refactor of OutputData mark_* functions 2018-05-22 21:43:41 +01:00
Ignotus Peverell
662db27ba4
Get block bodies from other fast sync'd nodes (#1073)
Previous code used to always get full blocks from archival peers.
Fast sync nodes shouldn't need to, other fast sync nodes have all
the history they need. This only uses archival nodes when blocks
are requested at a height that's older than the horizon.
2018-05-22 21:15:29 +01:00
Ignotus Peverell
f3fffa142f
Minor config file handling cleanup 2018-05-22 19:01:16 +01:00
Ignotus Peverell
90746537a3
Server panics when no config file is found
Can't do anything useful without config at this point, so we
might as well panic rather than confuse people. Minor cleanup of
config.
2018-05-22 18:50:09 +01:00
yeastplume
7281dc9473 ignore wallet integration test 2018-05-21 17:01:05 +01:00
Yeastplume
85285473bd
[WIP] Wallet refactor - part 3 (#1072)
* Beginning to rework aggsig library workflow

* more refactoring of transaction api

* whoever does round 1 first creates offset

* slate finalisation now context-free, so anyone can do it

* remove concept of transaction phase

* remove slate phase enum

* update actual send/receive code with new transaction lib workflow
2018-05-21 16:28:11 +01:00
Yeastplume
4bbaa8d05f
Move aggsig transaction building functions into separate lib (#1061)
* refactoring transaction building code

* serialise return transaction

* move shared functions into transactions, ensure wallet manipulation is only done outside of aggsig transaction lib

* remove unneeded wallet config from fn

* adding test functions to facilitate libwallet transaction testing

* rustfmt

* refactoring checker somewhat, adding ability to create and transactions against local copy of chain for simpler testing

* finish transaction testing functionality which verifies transactions work properly

* Remove wallet output manipulation from transaction building lib

* ensure sender expects full transaction back on last phase

* ensure sender expects full transaction back on last phase
2018-05-16 13:18:09 +01:00
Ignotus Peverell
24e21f013d
First pass at a colored paper TOC 2018-05-16 03:22:41 +01:00
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