Commit Graph

125 Commits

Author SHA1 Message Date
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
Ignotus Peverell 9b5125c553 Required sudo in travis config to build rocksdb. 2016-12-15 17:02:27 -08:00
Ignotus Peverell 1042aba65d Badges. 2016-12-15 16:46:16 -08:00
Ignotus Peverell 8936e93482 Trying travis without sudo option. 2016-12-15 16:37:02 -08:00
Ignotus Peverell 959474dc12 Different way to get rustdb build work with Travis. 2016-12-15 16:24:30 -08:00
Ignotus Peverell 32eaac3aa7 Updated GCC version for Travis to build RocksDB. 2016-12-15 16:18:03 -08:00
Ignotus Peverell d6aedc0922 Typo in travis yml 2016-12-15 16:11:47 -08:00
Ignotus Peverell 6536be19fe Fixed travis config. 2016-12-15 15:52:47 -08:00
Ignotus Peverell 144b316a4b First pass at a Travis CI config. 2016-12-15 15:44:52 -08:00
Ignotus Peverell bc61c5dae7 Read block and transaction messages and forward to the adapter. 2016-12-15 14:57:04 -08:00
Ignotus Peverell d395b3d128 Added another server implementation for when the client needs to stay in control of the event loop (i.e. multiple servers for tests). Test to spin up 5 servers and connect them all together. 2016-12-14 16:10:39 -08:00
Ignotus Peverell 8a255c0218 Formatting. 2016-12-13 19:21:49 -08:00
Ignotus Peverell 19a700b81e Minor fixes, testing server peer count. 2016-12-13 16:05:24 -08:00
Ignotus Peverell 7bea7341ab Various cleanup and reorganization. 2016-12-11 13:04:52 -08:00
Ignotus Peverell 4b5c010b05 Rewrote most of p2p code to use futures-rs instead of mioco. Need some cleanup and support for a few more message types. 2016-12-10 19:11:49 -08:00
Ignotus Peverell 9ea3389aea Added reference to the mailing list. 2016-12-08 10:22:06 -08:00
Ignotus Peverell eb56d40807 Removed limit on number of inputs or outputs in blocks and transactions. For DoS protection only a total message size needs to be enforced by the p2p layer. 2016-12-07 18:54:28 -08:00
Ignotus Peverell 2e860d04cf Clarifying comment for rejection of blocks too far in future. 2016-11-30 16:26:04 -08:00
Ignotus Peverell 4d7bc2269b Fixed retargeting tests for truncation. 2016-11-30 11:15:49 -08:00
Ignotus Peverell ea1820cff7 Fixed usages of block constructor. 2016-11-30 11:15:23 -08:00
Ignotus Peverell 715cc44d93 Use proper target when mining in test. 2016-11-29 20:07:08 -08:00
Ignotus Peverell 55f5771a2a Avoid unecessary move of the previous block header to build a block. 2016-11-29 20:05:35 -08:00
Ignotus Peverell 2e52b13c35 Date format uses year since 1900. 2016-11-29 20:04:13 -08:00
Ignotus Peverell 1ab9001338 Target needs to be truncated after next target calculation, given that serialization in the block header does it anyway. 2016-11-29 20:03:43 -08:00
Ignotus Peverell 0c52665f17 Server abstraction aggregating underlying modules (p2p, chain, etc.). Beginning of a test to start multiple servers, connect them and mine. 2016-11-29 18:51:36 -08:00
Ignotus Peverell 309cb497f8 Configurable host and port for p2p server. Utility for client connection. 2016-11-29 18:49:03 -08:00