Commit Graph

300 Commits

Author SHA1 Message Date
Ignotus Peverell afb219ce5c Hashed impl only needed for empty arrays. 2017-04-03 18:10:55 -07:00
Ignotus Peverell fd26ec9753 Fix Hyper URL to URI ref 2017-03-23 18:04:49 -07:00
Ignotus Peverell 38d5d67e79 Add features bitmask to Block, Output, Kernel; coinbase validation
Block, Output and Kernel now have bitmasks to hold supported
features and eventually versioning. Will make adding features and
updates easier and open the possibility of soft forks.

First added feature for Output and Kernel is the marking of coinbase
related ones. Allows the validation of the coinbase part of a block.
2017-03-23 17:06:00 -07:00
Ignotus Peverell a57c4e8f04 Replace IRC with Gitter 2017-03-23 17:04:00 -07:00
Ignotus Peverell f9f69dea25 Small tweaks to intro doc following John Tromp's review
* Various typo fixes and minor improvements.
* Switch from v*G + k*H to r*G + v*G as symbols to stay more consistent
with the rest of the litterature.
2017-03-21 14:05:10 -07:00
Ignotus Peverell cc63c17f39 Link introduction doc in README. 2017-03-21 11:18:09 -07:00
Ignotus Peverell b6b815f6c1 Reintroduce block tests with new tx building
The build module introduced some facilities to build transactions
that can now be leveraged when building blocks and in related
tests.
2017-03-20 14:32:11 -07:00
Ignotus Peverell 6bd3fc0d48 Cleanup of Transaction and Block data structures
Some renaming and cleanup of the Input, Output, Transaction and
Block structs. The main change is the removal of all the overt
structures which are now replaced by a specialized module to
build transactions easily. More specifically:

* Rename the TxProof to TxKernel in Block to reflect the current
naming consensus in MimbleWimble.
* Change Input and Output to be plain structs instead of enums
making their manipulation a lot easier. The building of
transactions is now handled by the build module.
* Input now directly includes the commitment of the Output it's
spending instead of going through an intermediate hash.
* The new build module encapsulates all the transaction building
logic, making it very straightforward by chaining combinators.
* Moves some tests to the core mod.rs as they required being able
to build a transaction to test it.
2017-03-20 14:07:00 -07:00
Ignotus Peverell 95592d6624 Introduction to MimbleWimble and Grin
Documentation aimed at a technical audience, just requiring some basic
knowledge of bitcoin, to explain how MimbleWimble works and how it's
applied in Grin.
2017-03-20 09:57:54 -07:00
Ignotus Peverell cb84f588fb Small tweaks and addition to a Transaction to make 2-parts building easier. Unit test covering the standard exchange between 2 parties when building a transaction. 2017-03-11 13:48:33 -08:00
Ignotus Peverell f64d20749f Framework to define services as RESTful HTTP API services. Serde implementations for some core types. 2017-03-07 17:00:34 -08:00
Ignotus Peverell d900f0b934 P2P server cleanup of disconnected peers. Mark those that don't respect the protocol as banned. 2017-02-27 14:17:53 -08:00
Ignotus Peverell 7c72ccec7c Cleaned up error handling in p2p module. Setting peer status on disconnect. 2017-02-26 20:08:40 -08:00
Ignotus Peverell 78b223b4f0 Forgot to update seed address as well. 2017-02-19 11:08:57 -08:00
Ignotus Peverell ca04327922 Reintroducing Rust beta channel testing. 2017-02-18 19:05:18 -08:00
Ignotus Peverell c0e635071c Fixed p2p tests. 2017-02-18 18:56:07 -08:00
Ignotus Peverell eb024e91d2 Discovery and seeding of other peers. Relies either on a gist with IP addresses or a static list. Connects to a first list, sending peer request messages to discover more. Monitor the server to make sure there's always enough peer connections. 2017-02-18 18:42:34 -08:00
Ignotus Peverell 510feadce6 Minor compilation errors due to moving store Error. 2017-02-10 11:02:21 -08:00
Ignotus Peverell 786da24653 A db store for peer data. 2017-02-09 20:16:34 -08:00
Ignotus Peverell 85edf57366 Iterator for Readable impls stored in DB. 2017-02-09 20:15:22 -08:00
Ignotus Peverell 7ee408e067 Moved down to the store module some common persistence code. 2017-02-09 11:41:46 -08:00
Ignotus Peverell 1c2b70f78f Lower cuckoo graph size for test. 2017-02-07 15:12:35 -08:00
Ignotus Peverell 4af049a887 Added full node sync mode. Follows closely the bitcoin header-first sync. Related p2p messages and protocol. 2017-02-07 13:52:17 -08:00
Ignotus Peverell f6114231ae Added support for a header chain, in addition to the main chain. Main chain must strictly follow header chain but header chain is allowed to be ahead (for sync). 2017-02-07 13:50:01 -08:00
Ignotus Peverell 45b134ab30 PoW only ever needs the block header, full block unnecessary. 2017-02-07 13:48:11 -08:00
Ignotus Peverell dde54beb3f Hash needs to be writeable for network serialization. 2017-02-06 12:08:35 -08:00
Ignotus Peverell 426f4e9d6b Added support for batched writes. Updated to rocksdb 0.6.0. 2017-02-04 11:10:07 -08:00
Ignotus Peverell 2d81abc16c Added height as part of handshake to inform syncing. 2017-02-02 15:51:48 -08:00
Ignotus Peverell 7f029cb4c0 Added a Connection wrapper to handle timeouts when we want information from a peer in a request/response style. 2017-02-01 19:05:17 -08:00
Ignotus Peverell 572c1951e1 Introduced a higher-level connection abstraction, allowing the protocol to stay relatively simple. Deals with the lower level details of sending, receiving data, timeouts and dealing with futures. 2017-01-29 22:43:20 -08:00
greole dab3727159 minor typo fix (#32) 2017-01-27 19:17:28 -08:00
Ignotus Peverell 4a034018cb Block inputs and ouputs Merkle tree validation. 2017-01-25 11:44:37 -08:00
Ignotus Peverell fc2697e7d8 When the cuckoo size is reduced for tests, pow needs to be recomputed for the genesis block. 2017-01-23 14:34:02 -08:00
Ignotus Peverell 18043cf94d Rust beta seems to have a perf regression, disabling for now. 2017-01-10 13:41:50 -08:00
Ignotus Peverell 21eb690840 Ignore log initialization failure. 2017-01-10 11:24:14 -08:00
Ignotus Peverell cc9690ee8c Test for chain forks and head switching. 2017-01-09 20:30:02 -08:00
Ignotus Peverell dda223f25b Chain logic to support multiple forks, select the most worked fork as the head. Significantly simplified from the original direction as it doesn't seem that explicitly materializing forks is necessary. Simple total difficulty accounting in block headers helping a lot there. 2017-01-09 15:16:44 -08:00
Ignotus Peverell 85e3255ee4 Removed need for a PowHeader. Directly checking serialization mode in block header serialization instead. 2017-01-09 12:07:38 -08:00
Ignotus Peverell 8dac7580c6 Minor typos. 2017-01-02 14:56:58 -08:00
Ignotus Peverell 167f166f21 First pass at documenting syncing algorithms when a new node joins the network. 2017-01-02 14:51:07 -08:00
Ignotus Peverell ce23dda6cb Block headers maintain total difficulty up to previous. Changed all references of target to difficulty to stay consistent. Ported retargeting algo to use difficulty as well. 2016-12-26 15:39:31 -08:00
Ignotus Peverell 0cc786a1e5 Refactored server to share the same struct whether futures are exposed or not. Multi-server test now properly waits for a block instead of a timer. 2016-12-23 12:15:36 -08:00
Ignotus Peverell f067e18644 Adapters between the chain and the network for block broadcast. First working test that spins up 5 servers, connects them all together, mine a block on one and watch it getting added to all the other servers chains. Some improvements still needed to automate the test properly. 2016-12-20 17:39:02 -08:00
Ignotus Peverell 17104977de Several bug fixes to the miner loop. Now builds the block properly and updates the shared head state. 2016-12-20 17:36:48 -08:00
Ignotus Peverell 57eb7ad0a9 A few more basic block checks in the chain pipeline. Added a chain adapter trait that's notified when a block is accepted. 2016-12-20 17:35:04 -08:00
Ignotus Peverell dc33ebcf39 Network block broadcasting. 2016-12-20 17:33:20 -08:00
Ignotus Peverell c1340223de Minor API change to PoW verify, to use the size provided by the block header by default. 2016-12-20 17:32:19 -08: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
Ignotus Peverell e688ff99e6 Started putting in place the adapter between the chain and p2p modules to forward blocks and transactions. Cleaned up chain store references. 2016-12-18 15:51:54 -08:00
GarrickOllivander 2e6d3d9fdb Safer serialization of base types (#18)
* use MESSAGE_SIZE constant instead of 32
* use Hashed trait in genesis
* safer serialization of Hash
* Hashed of [u8] should send only data to hash function, not length + data
* Safer serialization of Proof
* Safer serialization of Commitment
* Safer serialization of RangeProof
* introduce read_limited_vec instead of potential panic in conversion
2016-12-17 13:44:14 -08:00