Commit graph

929 commits

Author SHA1 Message Date
Yeastplume
07bf22c881 cuckoo miner update (#145)
* update cuckoo-miner tag
* not mining by default
* update to mean parameter
* update to mining param
* final update to compatible mean miner
2017-09-29 16:58:43 +00:00
Ignotus Peverell
8c051da960
Links fix 2017-09-28 20:15:23 +00:00
Ignotus Peverell
8796602fb9
Add code of conduct 2017-09-28 20:12:29 +00:00
Ignotus Peverell
36bcd3cc39 Integrate sum trees with the rest of the system (#116)
* Integrate PMMR and its persistent backend with the Chain
* Chain can set tree roots; PMMR backend discard
* Check spent and prune for each input in new block
* Handling of forks by rewinding the state
* More PMMR tests and fixes, mostly around rewind
* Rewrite get_unspent to use the sumtrees, fix remaining compilation issues
2017-09-27 23:46:32 +00:00
AntiochP
8800d1339d Wallet: key fingerprint as string (#142)
* wallet key fingerprint as hex string
* use lowercase hex in util::to_hex for consistency with various crypto libs, add some tests for util::to_hex and util::from_hex
* filter wallet info based on ext_key fingerprint
* cleanup format for fingerprints and output status
2017-09-27 23:03:59 +00:00
AntiochP
0b26a57ca6 Remove rust-crypto dependency (#141)
Use blake2b in wallet for key derivation and key identifiers
2017-09-26 22:51:45 +00:00
Yeastplume
53d9ca630c Cuckoo-miner update - Multiple Plugin mining (#139)
* Adding ability to load multiple mining plugins in parallel via cuckoo miner
* updating with newest cuckoo-miner changes
* revert default config value
* update pow document with link to podcast
2017-09-26 17:58:56 +00:00
AntiochP
7d48e1da49 Use util::from_hex and get rid of dependency on rust-serialize in wallet (#136) 2017-09-24 04:41:35 +00:00
AntiochP
670aa11e5a expose "wallet info" on CLI (#132)
* expose "wallet info" on CLI
* add sleep and retry logic when obtaining wallet.lock
* fix pool test for immature coinbase
2017-09-24 04:40:31 +00:00
AntiochP
a5b2c7d3f2 Introduce Identifier and Fingerprint to ExtendedKeys (#129) 2017-09-22 16:45:06 +00:00
AntiochP
dbc4e10cec Wallet now supports coinbase maturity (#130) 2017-09-22 16:44:12 +00:00
AntiochP
139af79509 wallet listens by default on 13416 (#128)
wallet should default to checking against node on port 13413
2017-09-21 21:12:07 +00:00
AntiochP
7c5b7d23e7 Replace secp256k1 directory with repository dependency (#126)
* workaround the "commitment is not a public key" problem by using to_two_keys() from rust-secp256k1-zkp
* remove secp256k1zkp, update the various Cargo.toml to use rust-secp256k1-zkp from external git repo, update code to not rely on to_pubkey (and use verify_from_commit)
* secp256k1zkp from git
* cleanup secp256k1 dependencies
* gitignore node1 and node2 dirs
2017-09-21 00:07:40 +00:00
AntiochP
44c8f9e22d fix the range_proof call (missing nonce param) (#125) 2017-09-13 20:00:48 +00:00
AntiochP
95a92eefc9 Cannot spend coinbase for N blocks (#111)
* use head_header in add_to_memory_pool
* add COINBASE_MATURITY const to consensus
* add coinbase maturity (wip) validaton rule to validate_block
* add coinbase maturity check to validate_block
* map errors in adapters - specific errors still wip
* reworked so adapter translates chain errors to pool errors (core errors not required)
* add test for spending immature coinbase in memory pool
* wip - add test to cover spending coinbase output in chain.process_block
* added test coverage around process_block - we have a problem with coinbase output commitments
* add a comment on the failing test
* process_block will now fail validation if we attempt to spend coinbase that has not yet matured
(remember to use a new reward_key for every block). test coverage in place to verify this
2017-09-12 17:24:24 +00:00
osaka-kun
6493468959 Checking rangeproof explanatory comment (#120) 2017-09-12 17:20:26 +00:00
AntiochP
4aea4d0548 fixes to allow benchmarks to be run for core (#122)
cargo +nightly bench -p grin_core
2017-09-12 17:20:01 +00:00
AntiochP
87cd0e5c58 added basic tests around range_proof (#121)
Pass nonce in to range_proof (we need it for rewind_range_proof, at least for testing)
2017-09-10 18:31:41 +00:00
AntiochP
6056c16cfa unit tests around Commitment summing (#118)
* unit tests around Commitment summing
* add a more complete test example with a commit_value to cover the excess
2017-09-09 17:48:26 +00:00
Seamus Finnigan
33688e9958 Small formatting, typographical, and grammatical edits to documentation (#117)
* Fix indentation issue on structured list
* Fix small typographical and grammatical errors in docs
2017-09-07 18:19:19 +00:00
Yeastplume
798849d7e9 Range Proof doc and intro update (#114)
* adding rangeproof doc
* changes to intro doc to represent range proofs
* updating build and config doc with info on platforms and the configuration file
* added reference to introduction document
2017-09-06 22:38:55 +00:00
Ignotus Peverell
405a4bc985 Prunable MMR storage (#112)
* Base MMR storage structures

Implementations of the MMR append-only file structure and its
remove log. The append-only file is backed by a mmap for read
access. The remove log is stored in memory for quick checking
and backed by a simple file to persist it.
* Add PMMR backend buffer, make PMMR Backend mutable
* The Backend trait now has &mut self methods, and an &mut
reference in PMMR. This simplifies the implementation of all
backends by not forcing them to be interior mutable. Slight
drawback is that a backend can't be used directly as long as it's
used by a PMMR instance.
* Introduced a buffer in the PMMR persistent backend to allow
reads before the underlying files are fully flushed. Implemented
with a temporary VecBackend.
* Implement a prune list to use with dense backends
The PruneList is useful when implementing compact backends for a PMMR (for
example a single large byte array or a file). As nodes get pruned and
removed from the backend to free space, the backend will get more compact
but positions of a node within the PMMR will not match positions in the
backend storage anymore. The PruneList accounts for that mismatch and does
the position translation.
* PMMR store compaction
Implement actual pruning of the underlying PMMR storage by
flushing the remove log. This triggers a rewrite of the PMMR nodes
data (hashes and sums), removing pruned nodes. The information of
what has been removed is kept in a prune list and the remove log
is truncated.
* PMMR store pruning tests and fixes
2017-09-05 05:50:25 +00:00
Yeastplume
301e9a6e98 Reconcile config file with command line switches (#113)
* allowing mix of command line and config file values
* rustfmt check
2017-09-05 01:34:24 +00:00
Ignotus Peverell
66255dfe83 Minor update, add link to issues 2017-09-01 03:26:26 +00:00
AntiochP
510d7fc331 git pre-commit hook to run rustfmt on modified files (#110)
* git pre-commit hook to run rustfmt on modified files
* add docs for rustfmt
* add CONTRIBUTING file
2017-09-01 00:54:15 +00:00
AntiochP
7b12746a1f Store block header hash by input and output commitment (#104)
* initial pass at indexing block header hashes by commitments
* check block height matches currently indexed block height
when getting block header for an output commit
* add some test coverage
* document get_block_header_by_output_commit
2017-08-29 16:32:45 +00:00
Yeastplume
b5e62c81c0 Switch commitments in libsecp fork (#109)
* first pass at switch committment generator
* create sage generator script
2017-08-29 16:27:01 +00:00
Seamus Finnigan
9c649edfbf Use UTC in timestamps and fix broken header test (#105)
* Fix block header timestamp UTC and fix test
* Always use UTC for timestamp as time::Tm
2017-08-26 16:31:27 +00:00
Yeastplume
3bf06ecd6a Cuckoo miner with cmake update (#103)
* updating to use cuckoo-miner latest, which uses cmake
* check on travis CI dependency
2017-08-24 21:43:11 +00:00
AntiochP
5febcb509c Add wallet to the travis build matrix (#102) 2017-08-23 08:29:22 +00:00
AntiochP
fa339f3c0b fix up wallet tests (#101)
fix wallet tests
add test to verify input commitment == output commitment on spend
2017-08-22 23:05:56 +00:00
AntiochP
babb6110c4 unit tests for coinbase flags (output and tx kernel) (#99)
* add tests around flipping COINBASE_OUTPUT and COINBASE_KERNEL flags
* add serialize_deserialize test for a minimal block
2017-08-22 18:26:13 +00:00
Yeastplume
045f5bb4da POW refactor (#100)
* Adding output stats from plugin, when available
* adding grin config
* moving pow crate from core/pow to it's own crate
* moving POW/mining stuff into pow module, and removing mining dependency from chain
* refactored most of mining into pow module...miner.rs still in server
* update grin tests
* updating genesis block mining to use configured miner, if available
* chain tests back into chain, done with pow refactor
* use tag of cuckoo-miner for pr
2017-08-22 18:23:54 +00:00
Riccardo Casatta
6772d9f516 various typos in docs (#95)
* various typos in docs
* fix a number in comments
2017-08-21 16:56:26 +00:00
Yeastplume
b61c0607c2 Fix inconsistent wallet receiver port
Fixes #96
2017-08-18 23:01:19 +00:00
AntiochP
900c52424d add "cache: cargo" to travis config (#92) 2017-08-11 21:09:30 +00:00
Yeastplume
2a275a2f87 POW Blake 2 changeover (#91)
* playing around with changing cuckoo sizes on the fly
* modifying tests to use global cuckoo parameters, and checking results
* check for pow size
* Changing global function names, and removing length from POW serialization
* changes to use blake2 for cuckoo seed generation
* updating tests to blake 2
2017-08-11 21:05:59 +00:00
AntiochP
be6b26e8f1 clean up .grin and .grin2 dirs before running the respective tests (#93) 2017-08-11 21:04:47 +00:00
AntiochP
3b4a48b2fd Cleanup build warnings (#87)
* minor cleanup - unused imports
* cleanup build warnings - unused vars
* make structs pub to get rid of the private_in_public lint warning
* missing docs on RangeProof
* add missing docs to store delete function
* cleaned up deprecation warning -
tokio_core -> tokio_io
complete() -> send()
2017-08-10 00:54:10 +00:00
Yeastplume
131ea2f799 Ci mode fixes (#86)
* playing around with changing cuckoo sizes on the fly
* modifying tests to use global cuckoo parameters, and checking results
* check for pow size
* Changing global function names, and removing length from POW serialization
2017-08-09 16:40:23 +00:00
Ignotus Peverell
d32ab967f0
Prunable and easy to store MMR impl 2017-08-05 09:32:41 +00:00
Ignotus Peverell
ae9a9c8938
Merge branch 'master' of github.com:ignopeverell/grin 2017-08-04 19:52:04 +00:00
Ignotus Peverell
95fe570187
Prunable and easy to store MMR impl 2017-08-04 19:50:32 +00:00
Yeastplume
cdf4203dd1 Cuckoo miner integration, Queue implementation (#84)
* Adding ability to serialise parts of the header, pre-nonce and post-nonce
* Some test integration of queueing functions in cuckoo-miner
* more cuckoo-miner async mode integration, now more or less working
* integrating async miner workflow
* rocksdb update
* u64 internal difficulty representation, and integration of latest Cuckoo-miner API
* change to cuckoo-miner notify function
* Issue in testing, and if use_async value is None in grin.toml
* making async mode explicit in tests - 2
* fiddle with port numbers for CI
* update tag to ensure cuckoo-miner build doesn't fail on windows
* change the order in which tests are run
2017-08-03 16:57:55 +00:00
Ignotus Peverell
c994c7cba2
Capture options with orphan block, fix #83 2017-07-28 02:21:00 +00:00
Ignotus Peverell
b3e224b439
Minor fixes to orphan handling
Fixed sync pathway in validation pipeline not returning the proper
orphan error. Reduced chain head lock span to prevent deadlock on
reentrancy.
2017-07-27 23:47:33 +00:00
Ignotus Peverell
22bff54f66
rustfmt (new version) 2017-07-27 21:13:34 +00:00
Ignotus Peverell
3c3b12b13a
Chain handles orphaned blocks and retries them
When a new block is rejected by the validation pipeline as orphan,
the chain now keeps it in a ring buffer of capped size. Anytime
a new block is accepted, all orphans in the ring buffer are
retried. This is helpful to handle all the cases where we receive
blocks out of order for networking/timing reasons.
2017-07-27 19:08:48 +00:00
Ignotus Peverell
f0044c631f
Minor warnings cleanup, rustfmt 2017-07-26 01:43:17 +00:00
Ignotus Peverell
a6047903d2
Sum tree: n_children -> n_leaves (more explicit) 2017-07-24 21:46:22 +00:00