Commit graph

1078 commits

Author SHA1 Message Date
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
Antioch Peverell
43540b36f6
refactor path fn to be cleaner and more readable (#1195) 2018-06-25 16:28:06 -04:00
Antioch Peverell
510a5b9016
fix build warning as per warning text (#1198) 2018-06-25 16:24:48 -04:00
mimblewimble-robot
cb0ce311dc document kernel offsets (finally) (#1197) 2018-06-25 16:14:48 -04:00
Antioch Peverell
ce2d13e8ac
document kernel offsets (finally) (#1196) 2018-06-25 15:24:26 -04:00
Antioch Peverell
ddcd9dc1d7
implement prune_list as a bitmap (#1179)
* 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-25 07:57:19 -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
Antioch Peverell
8c0bc013bc
document proposals for - (#1190)
* conditional timelocked outputs, and
* conditional relative timelocked outputs
2018-06-23 22:29:37 -04: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:

6fcecf516a

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
Antioch Peverell
3439041807
pin croaring to version 0.3.2 until we get the clang conflict sorted out (#1183) 2018-06-21 09:52:39 -04:00
mimblewimble-robot
bb95d303f5 [milestone/testnet3] Handle SIGINT and SIGTERM (#1182)
* Handle SIGINT and SIGTERM
2018-06-20 23:16:02 -04:00
Quentin Le Sceller
9f8c7cf1b4
Handle SIGINT and SIGTERM (#1180)
* Handle SIGINT and SIGTERM
2018-06-20 23:15:30 -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
Yeastplume
88616fd341
[WIP] Updates to support web-wallet (#1160)
* updates to support web wallet workflow

* rustfmt

* functions to support wallet, error handling

* rustfmt

* rebase rustfmt

* test fix
2018-06-13 21:58:45 +01:00
Ignotus Peverell
922b04608f
Clarification on range element count and parent insertion 2018-06-13 21:14:28 +01:00
Quentin Le Sceller
8f4dbfa540 Many typo fixes (#1158)
* Typo fix
* Parameterise
2018-06-13 17:03:34 +01:00