Commit graph

804 commits

Author SHA1 Message Date
Antioch Peverell
7816f35238
rewind to header as part of txhashset validation (#808)
* rewind to header as part of txhashset validation
otherwise we risk including a new block and the roots do not match

* fix bug in rm_log rewind (wants to be inclusive of provided index)

* put block marker in the index so we can rewind correctly
during validation of the new txhashset

* rustfmt
2018-03-19 21:31:57 -04:00
Ignotus Peverell
cd72be893e
Do not request orphan predecessor if we have its header. Shows we're already on it (sync). 2018-03-19 22:17:59 +00:00
Ignotus Peverell
154d52e548
Unecessary block cloning in chain 2018-03-19 21:02:02 +00:00
yeastplume
3c5dc1a29a enable tui by default 2018-03-19 19:24:21 +00:00
Yeastplume
4886fa08b2
TUI Difficulty stats for past few blocks (#805)
* added mining subview, changed main menu selection

* collecting difficulty stats from miner

* add diff calc view, separate server stats

* rustfmt

* block difficulty data output

* rustfmt

* ensure diff data is always shown

* don't write to stderr when tui running
2018-03-19 19:23:58 +00:00
Roman Zeyde
e312054714 Fix small formatting issue at dandelion.md (#811) 2018-03-19 16:55:48 +00:00
Roman Zeyde
d4eb24d16a Fix a small comment typo (#810) 2018-03-19 16:55:17 +00:00
Simon B
7c3994e521 Cleanup docs before testnet2 (#798)
* move FAQ.md to https://github.com/mimblewimble/docs/wiki/FAQ and unduplicate (Troubleshooting segment already present on its own wiki page)
* Update doc/style and move it into CONTRIBUTING.
* group up docs overview for more clarity
* link to previously unlinked content in the docs overview
* update + cleanup doc/build
* Update links to reflect troubleshooting is now only in the wiki
* More link fixes and spelling
* Remove doc/usage.md that I've faile to keep updated, and use a wiki page instead
* Last forgotten CONTRIBUTING.md fix
2018-03-17 18:08:40 +00:00
Ignotus Peverell
2fb97eb87f
Minor increase to max tx input count 2018-03-16 22:26:36 +00:00
Alexey Miroshkin
1b3541245a Fix limits for Transaction (#800)
In prevPRr I set them too high, also typos in comments were fixed.
2018-03-16 22:23:10 +00:00
Alexey Miroshkin
c96838d54d Improve bounding block timestamp (#793)
Fixes #783.
* 2^60 still fails on OSX, experimentally found safe max 2^55
* Handle negative values

I tried to use .abs(), unfortuantely fuzz test kills it with
`panicked at 'attempt to negate with overflow', /Users/travis/build/rust-lang/rust/src/libcore/num/mod.rs:1146:17`
2018-03-16 22:20:40 +00:00
Yeastplume
b53b84b0c6 Move nonce/pow to end of block header, change post-pow hash (#794)
* move nonce/pow to end of block header, update call to cuckoo-miner
* change header hash to be pow only
* fix genesis block miner and tests
2018-03-16 19:04:31 +00:00
Alexey Miroshkin
1bad7188b7 Fix Readable impl for Transaction (#795)
Fuzz test demonstrated that the current implemenation panics on reading from the network when serialized tx. Contains for example huge number of input or outputs. It allows a mailicious sender
to kill the server.
2018-03-16 19:02:22 +00:00
Antioch Peverell
cb71386097
hash with the pos for non-leaf nodes (#788)
* hash_with_index on non-leaf nodes
rework the Merkle proof to include the pos of each sibling in the path

* rustfmt

* cleanup

* cleanup

* use get_from_file in validate (children may have been "removed")

* rustfmt

* fixup store tests
2018-03-16 10:45:58 -04:00
Yeastplume
efae2d8ce6
updates to Cursive master and tying dependency to own fork (#787) 2018-03-16 09:53:02 +00:00
Simon B
198edb93dd Fixes #790 (#791) 2018-03-15 20:48:46 -04:00
Antioch Peverell
2552b34118
remove difficulty field from block_header (derive from total_difficulty) (#777)
* remove difficulty field from block_header (derive from total_difficulty)

* address feedback on PR and general cleanup

* rustfmt

* rework pow/difficulty validation in pipe::validate_header
now that we only have total_difficulty available

* cleanup various todos

* rustfmt

* rework DifficultyIterator to track header and prev_header state

* rustfmt caught some garbage syntax

* cleanup
2018-03-15 15:16:34 -04:00
Ignotus Peverell
e4871065b0
Bounding block timestamp to avoid surprises. Fixes #783 2018-03-15 18:37:17 +00:00
Yeastplume
244fc8d32e
PMMR data compaction (#784)
* fix and re-introduce data file compaction

* rustfmt

* remove commented line

* test cleanup

* remove println

* fix to core test
2018-03-15 17:12:30 +00:00
Antioch Peverell
00bfc4ec38
add dump_stats so we can see pmmr sizes after compaction (#785)
* add dump_stats so we can see pmmr sizes after compaction

* rustfmt

* fix tests with dump_stats()
2018-03-15 12:53:40 -04:00
Antioch Peverell
e75eef927b
Fix test dirs to isolate the tests (#786)
* 2 tests treading on each others dirs

* rustfmt

* actually use a different dir in each test...

* conflicting dirs across different test files also
2018-03-15 11:37:48 -04:00
Yeastplume
7f67542bc9
fix mining screen output (#776) 2018-03-14 19:07:18 +00:00
Yeastplume
449cefd5c9
hook to send panics and stacktraces to logs as well as stdout (#775) 2018-03-14 18:22:18 +00:00
Yeastplume
c02309ce87
Wallet listener and server startup ambiguity fix (#774)
* unify code path for server run and create wallet seed if it doesn't exist

* rustfmt
2018-03-14 18:21:48 +00:00
Antioch Peverell
6a1a45e21f
store "total kernel offset" on block header (#769)
* move from storing per block kernel_offset in the block header
to storing the total accumulated kernel offset on each block header

* rustfmt

* cleanup
2018-03-14 11:22:09 -04:00
Yeastplume
a8226da50d
change to bulletproof interface to separate nonce from blind in unwind (#773) 2018-03-14 11:03:09 +00:00
Antioch Peverell
65633c7611
check_compact retains leaves and roots until parents are pruned (#753)
* wip

* failing test for being too eager when pruning a sibling

* commit

* rustfmt

* [WIP] modified get_shift and get_leaf_shift to account for leaving "pruned but not compacted" leaves in place
Note: this currently breaks check_compact as nothing else is aware of the modified behavior

* rustfmt

* commit

* rustfmt

* basic prune/compact/shift working

* rustfmt

* commit

* rustfmt

* next_pruned_idx working (I think)

* commit

* horizon test uncovered some subtle issues - wip

* rustfmt

* cleanup

* rustfmt

* commit

* cleanup

* cleanup

* commit

* rustfmt

* contains -> binary_search

* rustfmt

* no need for height==0 special case

* wip - works for single compact, 2nd one breaks the mmr hashes

* commit

* rustfmt

* fixed it (needs a lot of cleanup)
we were not traversing all the way up to the peak if we pruned an entire tree
so rm_log and prune list were inconsistent

* multiple compact steps are working
data file not being copmacted currently (still to investigate)

* cleanup store tests

* cleanup

* cleanup up debug

* rustfmt

* take kernel offsets into account when summing kernels and outputs for full txhashset validation
validate chain state pre and post compaction

* rustfmt

* fix wallet refresh (we need block height to be refreshed on non-coinbase outputs)
otherwise we cannot spend them...

* rustfmt
2018-03-13 14:22:34 -04:00
Yeastplume
e268993f5e
[WIP] Needs more TUI (#765)
* first explorations at attempting to integrate more user-friendly status screen/ui

* rustfmt

* adding some logo and color for visual interest

* formatting

* better integration with stdout, cleaner looking startup and shutdown

* rustfmt

* update to framework, and first collection of stats from server

* rustfmt

* commit of basic stat screen, think it's in a good enough state to share

* rustfmt

* fix to automated tests

* fix to automated tests

* grin.toml setting

* grin.toml setting

* grin.toml setting

* merge from upstream

* merge from upstream

* merging

* merging

* formatting

* adding more status screens, beginning to collect peer data

* rustfmt

* beginnings of peer info

* adding tui dir

* rustfmt

* missing table

* create title bar

* Split up UI elements into separate files, create trait for update

* Added basic mining view
2018-03-13 18:10:45 +00:00
Ignotus Peverell
65c0a4b7b0
Fee burning no more. Fixes #767 2018-03-13 02:39:22 +00:00
Ignotus Peverell
a8fcc37a36
Automatically run wallet listener
Convenience option, set to true by default in grin.toml, to
fork a wallet listener thread by default. Should make it easier
for people to get started on testnet2.

People who want to configure a password for their wallet seed,
run multiple listeners, change default address should set this
to false and manually configure and start their wallet listener.

This might break some tooling. Hopefully not.
2018-03-11 00:40:28 +00:00
Ignotus Peverell
851d7c7b9b
Turns out libncurses5w is also required 2018-03-10 21:46:34 +00:00
Ignotus Peverell
86371e66ab
Added libncurses to the dependency list 2018-03-10 21:08:52 +00:00
Æde
bbbbdc455d Use header hash for by height index (#761)
* Use header hash for by height index
* Update semantics of save_header_height
2018-03-09 18:59:15 +00:00
Yeastplume
5cf780ab98
Rm log rewind on startup (#760)
* add rewind to block height to rm_log on startup

* add rewind to block height to rm_log on startup

* flush remove log
2018-03-09 17:17:48 +00:00
Yeastplume
23ac36a834
Basic TUI Integration (#756)
* first explorations at attempting to integrate more user-friendly status screen/ui

* rustfmt

* adding some logo and color for visual interest

* formatting

* better integration with stdout, cleaner looking startup and shutdown

* rustfmt

* update to framework, and first collection of stats from server

* rustfmt

* commit of basic stat screen, think it's in a good enough state to share

* rustfmt

* fix to automated tests

* fix to automated tests

* grin.toml setting

* grin.toml setting

* grin.toml setting
2018-03-09 17:16:31 +00:00
Ignotus Peverell
ab4b2a19e3
Cleanup positional indexes for rewind, introducing block markers (#759)
* Cleanup MMRs positional indexes. Get rid of the kernel position index.
Introduced a new block marker index that keeps, for each block, the
respective positions in the output and kernel MMRs. This is now sufficient
for rewind.
* Block marker compaction
2018-03-08 21:36:51 +00:00
Adam Jonas
a059bbde0d typo fix (#754) 2018-03-07 10:45:55 -05:00
Ignotus Peverell
a9d1b76414
Compaction of pruned data for chain data structures (#746)
* Implementation of compaction for the chain. Single entry point on the chain triggers compaction of all MMRs as well as the cleanup of the positional index and full blocks.
* API endpoint, additional tests and more fixes for compaction
* Also prune PMMR metadata, minor bug fix
* PMMR store tests fix
2018-03-06 17:58:33 +00:00
Ignotus Peverell
1ab43df807
Update install instructions with rustfmt-preview 2018-03-06 00:53:08 +00:00
Antioch Peverell
449fabf24f
cannot use write_mode in rustfmt.toml in stable (get rid of the warnings) (#752) 2018-03-05 15:23:52 -05:00
Yeastplume
1143d84238
Remove Sumtree References and disambiguate some naming (#747)
* start of renamathon

* api renaming

* Rename UTXO-Output to lessen ambiguity

* compile warning

* compile error

* readme fix

* remove file commit in error
2018-03-05 19:33:44 +00:00
Yeastplume
884906421c
comment cuckoo genesis back in (#751) 2018-03-05 15:52:26 +00:00
Yeastplume
90f844d382
Include index as part of pmmr element hash (#748)
* storing index as part of pmmr element hash

* factor out hash_with_index into generic trait impl

* tighten up trait bounds for PMMRable
2018-03-05 15:05:42 +00:00
Ignotus Peverell
63c5795eb9
Removing test coverage until it actually works 2018-03-04 19:52:55 +00:00
Ignotus Peverell
be8d9633e4
rustfmt all the things 2018-03-04 00:19:54 +00:00
Antioch Peverell
19565aea3d rustfmt now runs and reformats files (need to opt out explicitly) (#743) 2018-03-03 19:10:15 +00:00
Yeastplume
4c34c9ab52
PMMR Block to File positions metadata storage (#739)
* adding file position index data accessable to the chain, and allowing for storage of such within db

* missing file

* restart files at last recorded position in stored file metadata

* just use tip to store last pmmr index information

* error handling

* test fix
2018-03-03 09:08:36 +00:00
Antioch Peverell
cc12798d7a
Merkle Proofs (#716)
* family_branch() to recursively call family() up the branch
todo
  - we hit a peak, then we need to get to the root somehow
  - actually get the hashes to build the proof

* wip

* some additional testing around merkle tree branches

* track left/right branch for each sibling as we build the merkle path up

* MerkleProof and basic (incomplete) verify fn

* I think a MerkleProof verifies correctly now
need to test on test case with multiple peaks

* basic pmmr merkle proof working

* MerkleProof now serializable/deserializable

* coinbase maturity via merkle proof basically working

* ser/deser merkle proof into hex in api and wallet.dat

* cleanup

* wip - temporarily saving merkle proofs to the commit index

* assert merkle proof in store matches the rewound version
there are cases where it does not...

* commit

* commit

* can successfully rewind the output PMMR and generate a Merkle proof
need to fix the tests up now
and cleanup the code
and add docs for functions etc.

* core tests passing

* fixup chain tests using merkle proofs

* pool tests working with merkle proofs

* api tests working with merkle proof

* fix the broken comapct block hashing behavior
made nonce for short_ids explicit to help with this

* cleanup and comment as necessary

* cleanup variety of TODOs
2018-03-02 15:47:27 -05:00
Quentin Le Sceller
f2d709cb01 Fix wrong images in Dandelion docs (#742) 2018-03-02 17:59:41 +00:00
Quentin Le Sceller
6d7125b336 Add Dandelion docs (#740)
* Add scenario
* Update dandelion aggregation explanation
2018-03-02 03:18:47 +00:00