Commit Graph

30 Commits

Author SHA1 Message Date
Ignotus Peverell a7089d1975 Fixes for chain processing during bootstrap
Adds checks to ignore a block that's already known (can happen
if the block was saved but the chain update failed). Also saves
saves the chain slightly differently during bootstrap as the
header chain should only be updated when a header is received
(and not when we got a full block). Finally, do not broadcast
during bootstrap.
2017-04-27 21:59:53 -07:00
Ignotus Peverell 4e36c63cbb Save outputs under their own keys
Save outputs in every new block under their own hash. Done in the
same batch as the block. Allows for direct output lookups by hash
required by the p2p layer. Also store an index of output
commitment to output hash for wallet and input lookups.
2017-04-20 11:31:02 -07:00
Merope Riddle 39ddeb0a2a core: various cleanups, improvements, code comments (#38)
* core: cleanup slicing impls for Hash
* core: clean up Readable trait, implement Readable/Writeable for various integers
* core: change Hash debug output to hex
* core: correct warnings in all modules
2017-04-09 23:17:23 -07:00
Jacob Payne 9e82fb1774 Replace AsFixedBytes with Sized + AsRef<[u8]> (#35)
* Replace AsFixedBytes with Sized + AsRef<[u8]>
* Add AsRef<u8> to impl_array_newtype!
* Include AsFixedBytes as marker trait
* Related fixes
* Remove Deref
2017-04-06 22:54:54 -07:00
Ignotus Peverell 382754e54c Add workspace support for all crates 2017-04-05 23:41: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 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 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 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 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 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 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 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 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 2e860d04cf Clarifying comment for rejection of blocks too far in future. 2016-11-30 16:26:04 -08:00
Ignotus Peverell 715cc44d93 Use proper target when mining in test. 2016-11-29 20:07:08 -08:00
Ignotus Peverell 08f2f38098 Configurable path for chain db. Lowered test cuckoo size. 2016-11-29 18:45:39 -08:00
Ignotus Peverell 9795d9e452 Miner facility, using the current chain state to build on top of. 2016-11-27 12:31:15 -08:00
Ignotus Peverell 1e5ff0eeff Integration of target calculation with header validation and pow. Enforce strictly progessing time. 2016-11-16 17:03:23 -08:00
Ignotus Peverell 1d2b23a4a5 Several simple fixes to reflect changes from core (Result instead of Option for errors, consensus module, etc.) 2016-11-15 17:29:42 -08:00
Ignotus Peverell b1762cb5f4 p2p module getting close to first integration test allowing 2 peers to connect. Fleshed out handshake and protocol use. Fixed most errors, just need to make the borrow checker happy. 2016-10-25 22:06:13 -07:00
Ignotus Peverell 0855d7b41e Merge pull request #4 from merope07/cleanup-oct2016
Modularize several data structures in core
2016-10-23 15:58:56 -04:00
Ignotus Peverell c1cb57f3a9 Fixed wrong re-export. 2016-10-23 15:43:05 -04:00
Merope Riddle 9644fb6a73 Add apache 2.0 license header to all source files 2016-10-23 13:20:39 +00:00
Ignotus Peverell f73a308bf3 Initial import. 2016-10-20 20:06:12 -04:00