Commit Graph

981 Commits

Author SHA1 Message Date
Ignotus Peverell 26d41fefd0 Fix kernel history verification (#1218)
Only rewind kernels to avoid requiring proper bitmap extraction. Also avoids maintaining bitmap data for kernels by introducing a "prunable" flag on PMMR backend.
2018-07-05 03:31:08 +01:00
Ignotus Peverell ece2fcc56a Comment out kernel history check until fixed 2018-07-03 22:26:38 +01:00
Ignotus Peverell 6898b64628 Typo fix in T3 initial difficulty 2018-07-03 22:25:57 +01:00
Ignotus Peverell 1adffb5603 First config setup for T3, dummy genesis 2018-07-02 00:49:49 +01:00
Ignotus Peverell 551e9b13ad Oops, missed one fix 2018-07-02 00:25:50 +01:00
Ignotus Peverell 1a410f115c Cleanup a bunch of build warnings 2018-07-02 00:25:20 +01:00
Ignotus Peverell 2d4236f75b Introduce state to track sync stages (#1210) (#1211)
* A new sync status enum encapsulated in a state struct allows tracking of where sync is at. Leveraging it in the TUI to provide more helpful messages.
* Percentage progression for most sync steps
2018-07-02 00:08:39 +01:00
Yeastplume d2a84b7600 Error handling improvements (particularly in chain) (#1208)
* update error handling in chain and other modules to use error/errorkind

* sizeshift errorkind
2018-06-30 23:36:38 +01:00
Ignotus Peverell f0d5406d0b Fix cuckoo20 sizeshift in test 2018-06-30 05:07:24 +01:00
Ignotus Peverell 1398e0bf85 Accept multiple Cuckoo graph sizes (#1193)
* Added sizeshift to proof of work and encoding as VLQ
* Fix some loose ends to get things to compile
* Rename sizehift to min_sizeshift
  * Pipeline checks for PoW Cuckoo Cycle size shift and adjustment
factor before difficulty comparison.
  * Working delta+VLQ encoding of u64 PoW, unfortunately still a
little larger than u32, at least for Cuckoo30.
* Changed binary encoding of proof of work to a sequence of exact
compact bit representation of each nonce. Somewhat simpler,
shorter and matches the data to be hashed.
* Few fixes based on @tromp feedback:
* Max nonce is 2^(N-1)
* Need a separate constant for reference sizeshift
* Cuckoo implementation now conserves sizeshift. Test providing a
block at higher sizeshift.
* Last small overflow protection
2018-06-29 18:41:28 +01:00
Antioch Peverell 1df409fa69 verify coinbase maturity via output_mmr_size (#1203)
* we do not need Merkle proofs to spend coinbase outputs
we only need the output_mmr_size from the block header

* tests working with no Merkle proofs in inputs
2018-06-28 21:56:07 -04:00
Antioch Peverell d0f8d325f2 implement prune_list as a bitmap (#1179) (#1206)
* implement prune_list as a bitmap
and simplify

* cleanup prune_list, use maximum()

* handle migration of prune_list to new bitmap prun file

* legacy filename consts

* cleanup and docs
2018-06-28 20:53:00 -04:00
Yeastplume 5ac61b0bc8 fixes to wallet based on testing, ensure details file is being written properly for file wallet (#1204) 2018-06-27 16:57:40 +01:00
Yeastplume ccf862f76b T3 Wallet Restore fix and refactor (#1202)
* clean up wallet restore and underlying functions

* rustfmt

* refactor restore
2018-06-26 18:24:40 +01:00
Antioch Peverell 14667bfad6 cleanup path fn and add test coverage (#1201) 2018-06-26 09:42:12 -04:00
mimblewimble-robot 8ff8c8a128 fix build warning as per warning text (#1199) 2018-06-26 09:03:37 -04:00
mimblewimble-robot cb0ce311dc document kernel offsets (finally) (#1197) 2018-06-25 16:14:48 -04:00
mimblewimble-robot b7b90f4c24 document proposals for - * conditional timelocked outputs, and * conditional relative timelocked outputs (#1192) 2018-06-25 07:34:49 -04:00
Yeastplume 38a7936521 Use updated bulletproof API (#1194) 2018-06-25 12:28:56 +01:00
Ignotus Peverell dc827ebe93 Remove block markers, use header mmr pos instead (#1188)
Also fixes `spend_in_fork_and_compact` chain test.
2018-06-23 00:36:10 +01:00
Ignotus Peverell 3530b8300c Remove redundant hashing of header before proof of work (#1118)
We used to hash the hash of the header, needlessly. This also
makes a few function signatures more explicit.

Note that this is consensus breaking and should be accompanied
with a similar change on the cuckoo-pow repository:

https://github.com/mimblewimble/cuckoo-miner/commit/6fcecf516a111424d8bd5542fe20250e4f02cd8f

Fixes #1066
2018-06-22 22:59:56 +01:00
Ignotus Peverell 24cd5bc3e3 Less truncation in difficulty calculation (#1116) 2018-06-22 22:30:02 +01:00
yeastplume a5553ebba5 rustfmt 2018-06-22 14:05:03 +01:00
yeastplume 836d5441e6 fix wallet tests, chain test output 2018-06-22 14:04:51 +01:00
yeastplume 94322c796c rustfmt 2018-06-22 11:45:25 +01:00
yeastplume 8dfc7f3b2f rework block input bitmap logic to avoid batch locks 2018-06-22 11:44:50 +01:00
yeastplume e7c380836b rustfmt 2018-06-22 09:44:38 +01:00
yeastplume f058b14aea Merge: Compiling at least 2018-06-22 09:33:42 +01:00
Ignotus Peverell d189770080 Wallet LMDB backend (#1151)
* Migrate main node store to LMDB

In preparation to using LMDB as a wallet database, migrate the
node db. There's no point in having 2 key-value stores.
In addition LMDB provides a few advantages as a node db, namely a
much faster build (compared to RocksDb), lesser dependencies and
transactions.

* Migrated p2p store to lmdb, stuff compiles

* More fixes, chain tests starting to pass

* Fixed txhashset rollback messing with block save and general batch delimitation. Chain tests passing.

* rustfmt

* LMDB max map size of 10MB isn't really workable. Half TB seems reasonable.

* Fix wallet tests

* Rather crucial commit was missing

* rustfmt

* Fixing new merged tests following lmdb changes

* rustfmt

* * Make txhashset validation read-only on fast sync to avoid having
a really long open transaction.
* Fix deadlock in new block processing, batch should always be
created within a txhashset lock (when they interact).

* Comment about batch and txhashset interlacing

* Fix store tests to use batch

* Externalize wallet config and seed

* Converted direct read access to file outputs map to an iterator

* Cleaned up and simplified wallet Backend trait:

* No more direct mutable access to internal structures (HashMap)
* Batch interface for all writes
* Remove unneeded read wrapper (read_wallet)

* rustfmt

* First (incomplete) pass at wallet LMDB backend

* Progressing on lmdb backent iml

* Added batch impl for LMDB wallet backend. Pretty much done with it, but not sure how to deal with commit (owned).

* rustfmt

* Wrapping LMDB batch around a refcell to work around borrow rules

* Compilation up to grin chain
2018-06-22 09:08:06 +01:00
mimblewimble-robot bb95d303f5 [milestone/testnet3] Handle SIGINT and SIGTERM (#1182)
* Handle SIGINT and SIGTERM
2018-06-20 23:16:02 -04:00
Ignotus Peverell 0967a5302b Kernel sum and MMR sizes in block header (#1163)
* Add kernel commitments sum and kernel and output MMR sizes to block header
* Sum a block without including previous sums, cleanup. Blocks are now summed and validated based on their own totals and not the totals since genesis. This allows to get rid of BlockSum and simplified the setting of a new block's roots, kernel sum and MMR sizes. Fixes #116
* Additional kernel MMR validation to check all prior header roots successively
* Wallet tests fix
2018-06-21 02:30:22 +01:00
Antioch Peverell 8fee3b6922 [consensus breaking] use hash_with_index(pos - 1) when checking the hash in the MMR (#1114)
* use hash_with_index(pos - 1) when checking the hash in the MMR

* fix tests, get rid of todo related to duplicate commitments
2018-06-20 16:11:46 -04:00
Antioch Peverell c9229fa97b [consensus breaking] apply block outputs first (simplification) and add verify_cut_through() (#1112)
* CONSENSUS BREAKING - simplification apply_block just does outputs first

* rustfmt

* add verify_cut_through to both block and transaction
2018-06-20 15:47:32 -04:00
Antioch Peverell 0ff6763ee6 [consensus breaking] New Improved Merkle Proofs (#1119)
* new improved Merkle proofs

* fix pool and chain tests

* fixup core tests after the merge
2018-06-20 15:18:52 -04:00
Ignotus Peverell 70ba1c838c As per Travis CI advice trying sudo builds
Based on @bladedoyle's support request, should help with build stability.
2018-06-20 17:11:13 +01:00
Jeffrey Esquivel S 77eaf76706 Fix typo (#1181) 2018-06-20 09:31:55 -04:00
Blade Doyle 179ad5983f Update Stratum Server to use rust Result for returning errors (#1178) 2018-06-20 10:34:39 +01:00
Blade Doyle 0e969849c4 Fix rpc response message id (#1177) 2018-06-19 17:24:35 +01:00
Antioch Peverell 028b14d9d9 Replace rm_log with leaf_set (compact bitmap) (#1147)
* only store leaves in rm_log

* cleanup

* commit

* add failing test to cover case where we compact
an already compacted data file

* fix the logic for pruning the data file

* rm_log only contains leaves
prunelist only contains non-leaf subtree roots

* cleanup

* commit

* bitmap impl running in parallel

* rustfmt

* this is better - rewind unremoves outpu pos spent by rewound inputs

* commit

* commit

* pass bitmap around when rewinding

* store and retrieve input bitmap per block from the db

* Replace the RemoveLog with the UTXO set.

* utxo set starting to pass tests

* stuff works...

* split store types out
added some tests to compare the performance of the rm_log and the proposed utxo_set

* pull prune_list out into standalone file

* cleanup, get rid of unused height param

* cleanup and add doc comments

* add support for migrating rm_log to utxo_set

* take snapshot of utxo file during fast sync
implement migration of rm_log -> utxo_set

* rename rewound_copy to snapshot

* fixup pmmr tests to reflect cutoff_pos

* cleanup unused import

* check_compact needs to rewind the utxo_set as appropriate

* fix pool tests

* fixup core tests

* cache block_input_bitmaps via LruCache in store

* cache block header on initial write to db

* rename utxo_set -> leaf_set
and remove references to "spent" in grin_store

* better document the rewind behavior
2018-06-18 11:18:38 -04:00
Blade Doyle 59472e9570 StratumServer RPC extra-quotes fix (#1164)
* StratumServer RPC extra-quotes fix
* better - skip intermediate string
* Fix invalid json _ok_ response
* Undo protocol-breaking change to ok response
* use RpcError structure rather than string to avoid extra quoting
2018-06-17 20:08:17 +01:00
Ignotus Peverell 9b69b5376d More @tromp feedback 2018-06-17 00:48:54 +01:00
Ignotus Peverell df2d109281 Typo fix 2018-06-16 21:06:09 +01:00
Ignotus Peverell c2a4211660 Re-added bitcoin in the atomic swap section
Also added some minor clarifications on the setup and verification of `x*G` on other chain, as well as a more detailed section on how this would work on bitcoin.
2018-06-16 18:15:02 +01:00
Ignotus Peverell 934668d3f3 Fixes to the atomic swap section
Can only swap with Ethereum right now, not Bitcoin. Pubkey derivation is a hash function.
2018-06-16 16:46:28 +01:00
Quentin Le Sceller d3a2ecd489 Update env_logger to 0.5.1 (#1169)
* Update env_logger to 0.5.1
2018-06-14 18:59:53 -04:00
Ignotus Peverell 7993e511ea Minor: markdown formatting 2018-06-14 22:18:29 +01:00
Quentin Le Sceller c4f438fdb2 Typo and formatting (#1170) 2018-06-14 17:15:52 -04:00
Quentin Le Sceller c412bc6c60 Fix empty candidate txs (#1168) 2018-06-14 18:37:21 +01:00
Yeastplume 9e0b3b6862 Store additional wallet detail and WalletInfo cleanup (#1167)
* adding wallet detail file, clean up wallet info output

* rustfmt

* ensure change outputs aren't written early

* rustfmt

* travis problems AGAIN

* file wallet explicit types
2018-06-14 17:02:05 +01:00
Quentin Le Sceller a30ee88236 Cleanup imports (#1161)
Reorganize imports
2018-06-14 08:16:14 -04:00