Commit graph

187 commits

Author SHA1 Message Date
Simon B
f9b87164e7 Idiomatic cargo toml (#862)
* Specify versions SemVer-style
 - slog and serde
* Comments for not update-able pre-1.0 crates:
 - urlencoded at "0.5" since 0.6+ lacks trait `plugin::Plugin<iron::Request<'_, '_>>`
* alpha-sort deps
* Specify versions SemVer-style
 - backtrace, bitflags, blake2-rfc, bodyparser, built, byteorder
 - chrono, clap, demonize, enum_primitive, env_logger
 - failure, failure_derive, futures
 - hyper, iron, itertools, lazy_static, libc
 - memmap, mount, net2, num_bigint, prettytable-rs
 - rand, regex, rocksdb, router, siphasher
 - term, time, tokio-core, tokio-retry, urlencoded, uuid, walkdir, zip
2018-03-25 17:44:27 +00:00
Yeastplume
80887196a8
Restore wallet restore (#843)
* adding appropriate message to bulletproofs to allow for restore

* rustfmt

* should work, now test

* rustfmt

* fix to wallet restore, works now

* fix pool tests

* fix pool tests

* rustfmt
2018-03-23 10:13:57 +00:00
Simon B
e3601b6c8e Travis cleaner caching (#833)
* speed up Travis startup
- keep all test tempdata in target/tmp
- purge before saving target/* to S3 cache

* allow 4 minutes for cache up/download from Travis' S3 cache stores
2018-03-21 16:05:07 +00:00
Simon B
4fa9ccc4f7 Cargo.toml (#818)
* Make sure no grin crates get published by mistake: https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish--field-optional
* add missing workspace = '..', [workspace docs for interested readers](https://doc.rust-lang.org/cargo/reference/manifest.html#the-workspace-section)
* dev- or dev_ works equally well, but dev- is what's typically used
* authors = Grin Developers <maillist>
* [dependencies] keep grin-* at the end + readability
2018-03-20 18:21:29 +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
Yeastplume
449cefd5c9
hook to send panics and stacktraces to logs as well as stdout (#775) 2018-03-14 18:22:18 +00:00
Yeastplume
a8226da50d
change to bulletproof interface to separate nonce from blind in unwind (#773) 2018-03-14 11:03:09 +00: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
Ignotus Peverell
be8d9633e4
rustfmt all the things 2018-03-04 00:19:54 +00:00
Yeastplume
5d1f1af892
Bulletproof messages (#730)
* beginning to add bullet proof messages

* Updated core transaction creation to embed the output's value and switch commit hash as part of the rangeproof message

* formatting issue

* more formatting issues

* Removing conditional feature compliation.. just bulletproofs from now on

* ensure MAX_PROOF_SIZE uses bulletproof sizing instead of earlier version

* updated with switch commit committed to in extra data

* accidentally commented out bullet-proof-size feature
2018-02-27 21:11:55 +00:00
Ignotus Peverell
16d778a99b
Zip integration tests 2018-02-24 20:30:42 +00:00
Yeastplume
c63aa70a0b
Integrated bulletproofs into Grin with optional build parameter (enabled by default) (#711) 2018-02-16 20:34:54 +00:00
Ignotus Peverell
22c521eec8
[WIP] Abridged sync (#440)
* Util to zip and unzip directories
* First pass at sumtree request/response. Add message types, implement the exchange in the protocol, zip up the sumtree directory and stream the file over, with necessary adapter hooks.
* Implement the sumtree archive receive logicGets the sumtree archive data stream from the network and write it to a file. Unzip the file, place it at the right spot and reconstruct the sumtree data structure, rewinding where to the right spot.
* Sumtree hash structure validation
* Simplify sumtree backend buffering logic. The backend for a sumtree has to implement some in-memory buffering logic to provide a commit/rollback interface. The backend itself is an aggregate of 3 underlying storages (an append only file, a remove log and a skip list). The buffering was previously implemented both by the backend and some of the underlying storages. Now pushing back all buffering logic to the storages to keep the backend simpler.
* Add kernel append only store file to sumtrees. The chain sumtrees structure now also saves all kernels to a dedicated file. As that storage is implemented by the append only file wrapper, it's also rewind-aware.
* Full state validation. Checks that:
    - MMRs are sane (hash and sum each node)
    - Tree roots match the corresponding header
    - Kernel signatures are valid
    - Sum of all kernel excesses equals the sum of UTXO commitments
minus the supply
* Fast sync handoff to body sync. Once the fast-sync state is fully setup, get bacj in body sync
mode to get the full bodies of the last blocks we're missing.
* First fully working fast sync
* Facility in p2p conn to deal with attachments (raw binary after message).
* Re-introduced sumtree send and receive message handling using the above.
* Fixed test and finished updating all required db state after sumtree validation.
* Massaged a little bit the pipeline orphan check to still work after the new sumtrees have been setup.
* Various cleanup. Consolidated fast sync and full sync into a single function as they're very similar. Proper conditions to trigger a sumtree request and some checks on receiving it.
2018-02-09 22:32:16 +00:00
Quentin Le Sceller
fb46fad0ac Remove unused import and uniformize crates (#686)
* Removed unused crates
* Add listconnectedpeers in grin client
* Removed unused import and uniformize crates
2018-02-05 19:46:56 +00:00
AntiochP
916d9cce57
Revert "move siphash out of pow and into util" (#635)
* Revert "move siphash out of pow and into util (#633)"

This reverts commit dae90543c2.
2018-01-18 19:53:53 -05:00
AntiochP
dae90543c2 move siphash out of pow and into util (#633)
we are going to use this for generating short ids
2018-01-18 18:29:44 +00:00
Yeastplume
9704cc35bd Aggsig Serialization (#618)
* changing ser of aggsig signature
* serialise Signature as raw 64 bytes
* remove compact sig
* remove to_compact
* remove unused import
2018-01-15 20:45:26 +00:00
Yeastplume
1199ed2cc1
[WIP] Aggsig Transactions (#530)
* First steps converting transaction workflow to be aggsig-enable

* integrating updated version of aggsig, which gives greater control over the contents of e

* added wallet transaction test to testing framework to enable testing the whole thing, completed interaction as far as inital response from recipient

* more aggsig work, final signature is produced now

* Construction of aggsig transaction now working to the point of the signature being built

* aggsig transactions working end-to-end in the nominal case

* refactor aggsig verify from commit and fix some tests

* more cleanup and test fixing

* cleaning up automated tests

* test+formatting fix
2018-01-10 19:36:27 +00:00
Simon B
17d5898677 Forgotten testnet1 cherries (#475)
* Very quick peer banning endpoint, helps with #406
* Ping heights (#407)
* add height to ping/ping
* reformat output
* fix p2p test
* Fix orphan handling, not related to current head. Fixes #412
* Check before borrow, fixes #267
* Not finding an output commit in pos is an AlreadySpent
* Fix race condition, sending before conn is ready
* Explicit error for unknown pos of a forked block
* Remove config outdated tests. Fix #333
* Check ref and try before borrow, fix #400
* We do not want to sync with old peers anyway
* Hide cargo compiler warning for unused NoopAdapter and unused test code. Add TODOs
2017-12-13 21:52:21 +00:00
Yeastplume
18fc1384de updating secp256k tag to include aggsig library 2017-12-11 14:23:55 +00:00
Simon B
08a277f8d1 Log "nn.nnn coins spent using strategy ..." on log level Debug (#326)
* Log "nn.nnn coins spent using strategy ..." on log level Debug
* util::logger whitespace/cleanup
Add code comment about LOGGING_CONFIG injection
2017-11-19 13:34:43 -05:00
Yeastplume
48a60858ba Wallet output selection performance (#238)
* allow selecting a commit while providing a key index
* added static reference to libsecp that can be called throughout
* don't serialise rangeproof to json if it's not desired
2017-11-07 11:48:37 -05:00
Ignotus Peverell
e4ebb7c7cb
Cleanup HTTP APIs, update ports to avoid gap, rustfmt
Moved the HTTP APIs away from the REST endpoint abstraction and
to simpler Hyper handlers. Re-established all routes as v1.
Changed wallet receiver port to 13415 to avoid a gap in port
numbers.

Finally, rustfmt seems to have ignored specific files arguments,
running on everything.
2017-10-31 19:42:56 -04:00
Yeastplume
05d22cb632
changing secp import to tag, and consolidating Cargo.toml import (#220) 2017-10-31 23:20:55 +00:00
Ignotus Peverell
556dd012af
Last min changes always warrant a recompile... 2017-10-22 08:09:02 +00:00
Ignotus Peverell
f12559f53b
Logger init for tests 2017-10-22 07:09:40 +00:00
Ignotus Peverell
37cc919f6e
Doc for new OneTime.is_initialized 2017-10-17 13:56:47 +00:00
Ignotus Peverell
28ac46c563
Do not sync when configured with no seeding 2017-10-17 13:51:02 +00:00
Yeastplume
49797853d9 tweaks to logging configuration (#176)
* tweaks to logging configuration
* doc port update
2017-10-13 16:42:04 +00:00
Yeastplume
8e382a7593 slog-rs logging (#171)
* added global slog instance, changed all logging macro formats to include logger instance
* adding configuration to logging, allowing for multiple log outputs
* updates to test, changes to build docs
* rustfmt
* moving logging functions into util crate
2017-10-12 16:56:44 +00:00
Ignotus Peverell
8504efb796
Cargo fmt all the things 2017-09-29 18:44:25 +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
Ignotus Peverell
15ea8da34a
New Chain struct acting as facade for all chain operations
Introduce a new Chain struct that maintains the current head,
acts as facade to the store and the block processing pipeline
and handles all appropriate locking.

All higher level components, like the overall server, REST APIs
and miner have been update to only depend on Chain. Cleaned up
some duplication and tests now that there's a single entry point
to all blockchain operations.
2017-07-04 09:17:11 -07:00
Ignotus Peverell
791d2355ee
Miner querying wallet receiver for coinbase output
With the coinbase receiver daemon in place, when starting a Grin
server in mining mode, the miner will now ask the receiver for a
coinbase output. The output is then used to insert in a block when
successfully mined.
2017-05-25 17:22:21 -07:00
Ignotus Peverell
ac553493f1
WIP: Wallet functionality to receive and send coins
Beginning of a first pass at simple wallet functionalities so
Grin can be used to author transactions. We introduce a
receiving server, to be at least able to build coinbase outputs
that can be used by the mining daemon.

Present:

* Coinbase receiving API.
* Command to start the receiving server.
* Beginning of a transaction sending command.
* Improvements to the REST API abstractions to support the above.

Still to do:

* Change to the miner daemon to use the receiving server.
* A command line sender.
* API to receive any transaction (not just coinbase).
* A command line receiver.

Beyond that, HD derivation and seed generation are very simple
so far and almost certainly insecure. Just for testing for now.
2017-05-24 16:09:39 -07:00
Ignotus Peverell
382754e54c
Add workspace support for all crates 2017-04-05 23:41:49 -07:00
Ignotus Peverell
0702ab1829
Utility crate for things that don't fit anywhere else. Helper struct to emcapsulate one time initializations with a RefCell of an Option. 2016-12-20 17:29:35 -08:00