Commit Graph

523 Commits

Author SHA1 Message Date
Paul Hauner
3876e29f6e
Fix clippy lints 2019-01-04 18:30:24 +11:00
Paul Hauner
62640ad691
Remove old chain maps and stores mods 2019-01-04 18:12:32 +11:00
Paul Hauner
8aa9f83c48
Implement new API for db stores 2019-01-04 17:55:15 +11:00
Paul Hauner
2b63ece244
Move beacon_chain into lighthouse dir 2018-12-30 12:59:24 +11:00
Paul Hauner
dc8fbf813f
Update db function signatures 2018-12-30 12:56:07 +11:00
Paul Hauner
41ef019d57
Add unfinished chain code 2018-12-29 15:00:51 +11:00
Paul Hauner
4757b35ed2
Wrap BLS keypair, pubkey and privkey in newtypes 2018-12-29 14:33:35 +11:00
Paul Hauner
f140e2938f
Update beacon_block_store for new block struct 2018-12-25 10:38:40 +11:00
Paul Hauner
91dea4bf29
Merge Rust 2018 updates 2018-12-24 10:03:56 +11:00
Stan Drozd
dcf9f2244a
Add 'edition = "2018"' to every Cargo.toml 2018-12-19 16:38:59 +01:00
Stan Drozd
e502872083
cargo-fix the whole workspace into Rust 2018 2018-12-19 16:07:01 +01:00
Paul Hauner
be4c6701ac
Remove SSZ helpers 2018-12-18 18:08:51 +11:00
Paul Hauner
4d0641636e
Rename AttestationRecord -> Attestation 2018-12-12 12:16:11 +11:00
Grant Wuerker
f64aa9e192 more validator tests 2018-12-02 19:21:17 -06:00
Grant Wuerker
1bd60062d9 renamed a couple tests 2018-11-20 19:51:43 -06:00
Grant Wuerker
1c5d04d727 a few more tests 2018-11-20 19:49:38 -06:00
Grant Wuerker
74ad689c21 removed cargo dep 2018-11-18 16:39:55 -06:00
Grant Wuerker
325e1b3f0a different hashes in pow store 2018-11-18 16:38:15 -06:00
Grant Wuerker
9148c20630 fixed warnings 2018-11-18 16:31:22 -06:00
Grant Wuerker
005efc2e7a beacon block tests 2018-11-18 11:00:05 -06:00
Grant Wuerker
bde0612e1d validator store cleanup 2018-11-17 19:06:24 -06:00
Grant Wuerker
66bb31616c Merge branch 'master' into stores-test-improvements 2018-11-17 10:50:09 -06:00
Grant Wuerker
66ca299092 rand import moved 2018-11-11 13:17:42 -06:00
Grant Wuerker
20961c612a pow chain store tests added 2018-11-11 13:15:39 -06:00
Paul Hauner
900ffac5e0
Run rustfmt globally.
Using `$ cargo fmt` in the root. Closes #68.
2018-11-04 15:35:55 +01:00
Paul Hauner
46da9b670f
Add untested minimum viable block processing 2018-10-30 15:49:32 +01:00
Paul Hauner
e27c4106e9
Add delete method to ClientDB 2018-10-29 20:28:50 +01:00
Paul Hauner
7f21fd325e
Add initial works on extending the chain 2018-10-25 10:14:43 +02:00
Paul Hauner
fa705229aa
Fix clippy lints 2018-10-16 15:24:50 +11:00
Paul Hauner
1207421d70
Fix broken block_store test 2018-10-16 13:46:18 +11:00
Paul Hauner
a862c82b37
Rename Block -> BeaconBlock
- Update types::block
- Update ssz_helpers::SszBlock
- Update db::stores::block_store
- Add new fields to types::Block
- Update SszBlock as per new Block fields
2018-10-15 14:57:14 +11:00
Paul Hauner
d729355c09
Add test to block_store, export BlockAtSlotError 2018-10-11 23:50:49 +11:00
Paul Hauner
8c1d72a32e
Return block hash with block_at_slot() 2018-10-10 20:51:13 +11:00
Paul Hauner
550ca79a4f
Add block_at_slot function to block store
This allows skipping back in the chain to find a block.
2018-10-10 18:16:30 +11:00
Paul Hauner
a65531ba95
Remove all libp2p and syncing code
This will all need to be rebuilt in the future.

This code will be available at a "legacy_libp2p" branch.
2018-10-09 13:36:54 +11:00
Age
8ae3c9adc1
small clippy fixes 2018-10-03 13:51:05 +10:00
Paul Hauner
0fbe4179b3
Heavily restructure repo
Separate most modules into crates
2018-10-02 16:41:10 +10:00
Paul Hauner
07bfd7e97d
Add tests for attestation_validation 2018-10-02 09:47:45 +10:00
Paul Hauner
cd3b2f5371
Add test for attestation msg generation 2018-10-02 09:47:20 +10:00
Paul Hauner
6b7677a206
Update block and attestation validation code 2018-10-02 09:46:14 +10:00
Paul Hauner
8e094b358f
Implement framework for testing attestation val. 2018-10-01 17:19:08 +09:30
Paul Hauner
8f5285875b
Refactor validation tests into integration tests 2018-10-01 16:37:34 +09:30
Paul Hauner
4d1f730c95
Restructure block validation directory 2018-09-30 16:25:28 +09:30
Paul Hauner
c3ec8a3407
Introduce AttestationValidationContext
This reduced code duplication.
2018-09-30 16:09:35 +09:30
Paul Hauner
b426c9e724
Remove "benches" feature
Now benches just live with the rest of the code in the default feature.
2018-09-30 16:09:07 +09:30
Paul Hauner
29ed29cfc3
Update benchmarks as per recent code changes 2018-09-30 15:38:22 +09:30
Paul Hauner
77b48b9822
Implement more tests for block validation 2018-09-30 14:25:42 +09:30
Paul Hauner
496adc0f0b
Fix bug in attestation val. bitfield checking
There was a logic error
2018-09-30 14:24:42 +09:30
Paul Hauner
9642c4b7e1
Simplify block validation tests
Move more parameters into get_simple_params()
2018-09-30 12:21:30 +09:30
Paul Hauner
5dd2361d21
Progress further with block validation
- Rename errors returned from SszBlock.
- Add parent_hash concept to block validation.
- Add more comments to block validation.
2018-09-30 11:26:36 +09:30
Paul Hauner
385564d637
Rename block_store functions
- Specified that the block is "serialized".
2018-09-30 11:25:12 +09:30
Paul Hauner
0b99951bf8
Refactor block val. into "BlockValidationContext" 2018-09-29 16:07:59 +09:30
Paul Hauner
bc27be147f
Further development on block validation
- Return a fully deserialized block from validate_ssz_block
- Ensure the parent_hash field is handled
2018-09-29 15:38:54 +09:30
Paul Hauner
e0e8aa98f4
Introduce "benches" feature
So that benchmarks don't run each time tests run
2018-09-29 13:01:33 +09:30
Paul Hauner
7c88f94377
Tidy comments in block validation 2018-09-29 12:32:33 +09:30
Paul Hauner
13467abd7f
Tidy benches file 2018-09-28 17:30:49 +09:30
Paul Hauner
8020b897c6
Refactor block val. benches to use test funtions 2018-09-28 17:15:42 +09:30
Paul Hauner
19ddbdefa8
Refact block val. tests to be more modular 2018-09-28 17:15:29 +09:30
Paul Hauner
b92d88d42b
Add (untested) parallelization for att validation 2018-09-28 15:38:51 +09:30
Paul Hauner
05fe231e41
Fix bug with bitfield validation 2018-09-28 15:37:53 +09:30
Paul Hauner
debc642b50
Move attestation validation into iter.for_each 2018-09-26 23:28:47 +10:00
Paul Hauner
a8b08fb300
Add first block validation benches 2018-09-26 14:06:16 +10:00
Paul Hauner
84bb40855f
Split block validation tests into functions 2018-09-26 13:31:58 +10:00
Paul Hauner
9dcec214af
Add block validation code
This was created in another branch along with a whole bunch of other
commits building out databases and other common elements.

This full history of these works is available on master, however it
should not be necessary.
2018-09-26 13:00:25 +10:00
Paul Hauner
baa7b06b56
Fix clippy lints 2018-09-26 11:54:13 +10:00
Paul Hauner
966d891cb5
Remove validation fns (will be added in a PR) 2018-09-26 11:40:28 +10:00
Paul Hauner
3188d32423
Fix unused dep warning 2018-09-26 11:38:12 +10:00
Paul Hauner
362b7b2513
Remove some stray print statements 2018-09-25 23:40:01 +10:00
Paul Hauner
eedfa8c8ea
Add more unique errors in validate ssz block 2018-09-25 23:35:10 +10:00
Paul Hauner
310662ee17
Fix shard_block_hash in block val. tests 2018-09-25 23:34:44 +10:00
Paul Hauner
177c04dc1a
Fix bitfield setting in block val. test 2018-09-25 23:34:25 +10:00
Paul Hauner
e1e494b9aa
Fix parent_hashes generation in block val. test 2018-09-25 23:33:20 +10:00
Paul Hauner
55e0e7d05d
Add/fix message hashing in block validation tests 2018-09-25 23:32:35 +10:00
Paul Hauner
6529b4c09f
Fix pub key getting in signature verification 2018-09-25 23:31:58 +10:00
Paul Hauner
9207a44bce
Fix parent_hashes bug in message_generation 2018-09-25 23:31:39 +10:00
Paul Hauner
8d2e9f33c7
Progress further with block validation tests 2018-09-25 22:10:47 +10:00
Paul Hauner
748b50c08c
Fix bit shift function in attestation validation 2018-09-25 22:10:12 +10:00
Paul Hauner
dc7d2ff150
Move helpers.rs into common/delegation 2018-09-25 12:32:51 +10:00
Paul Hauner
d9046e4c1b
Fix warnings 2018-09-25 12:32:40 +10:00
Paul Hauner
83d95f1d34
Restructure directories. Add dead_code allows 2018-09-25 12:20:13 +10:00
Paul Hauner
4212d8fc7d
Fix bug introduced in previous commit 2018-09-25 09:31:59 +10:00
Paul Hauner
bb81bacb4e
Add comments to attestation fns, fix bug 2018-09-25 09:29:56 +10:00
Paul Hauner
209076e371
Fix ssz_split bug 2018-09-25 07:17:14 +10:00
Paul Hauner
1677b6dcc8
Progress on block validation 2018-09-24 23:35:51 +10:00
Paul Hauner
2141b8c623
Add attestion ssz splitter, change dir structure 2018-09-24 21:53:42 +10:00
Paul Hauner
c55b94053b
Tidy validation signatures 2018-09-24 18:09:01 +10:00
Paul Hauner
26537c1184
Progress further on attestation validation 2018-09-24 18:08:48 +10:00
Paul Hauner
f9f5a9e49c
Implement error type specific to ValidatorStore 2018-09-24 18:08:00 +10:00
Paul Hauner
27743f3466
Extend tests for signature verification 2018-09-24 14:30:39 +10:00
Paul Hauner
be09fd4f29
Implement attestation signature validation and test 2018-09-24 14:16:48 +10:00
Paul Hauner
69c97745d2
Set MemoryDB to use constant DB columns
This is instead of needing to be passed them each time open() is called.
2018-09-24 14:15:59 +10:00
Paul Hauner
7f01ec7c27
Extend validator_store 2018-09-24 13:16:39 +10:00
Paul Hauner
2acf141ba3
Tidy up main.rs and attestation_validation.rs 2018-09-24 09:49:26 +10:00
Paul Hauner
67b11a394e
Add new bls-aggregates crates 2018-09-23 20:19:30 +10:00
Paul Hauner
3968aaa0e0
Derive debug for some error enum 2018-09-22 22:07:39 +10:00
Paul Hauner
75031f5e69
Progress on attestation validation 2018-09-22 22:00:11 +10:00
Paul Hauner
30bf97539c
Create unique errors for att. parent hashes 2018-09-22 21:59:44 +10:00
Paul Hauner
78de4e43e2
Add SSZ decoding for AttRec, fix length mistake 2018-09-22 15:54:25 +10:00
Paul Hauner
4d3422d332
Remove warnings, restructure validation files 2018-09-22 15:53:31 +10:00
Paul Hauner
5034089398
Merge branch 'block_processing' into validate_block 2018-09-22 12:30:23 +10:00
Paul Hauner
5c0690d39c
Merge branch 'v2.1-spec' into validate_block 2018-09-22 11:25:56 +10:00
Paul Hauner
bbf640c40d
Add progress to validate_block 2018-09-22 11:13:55 +10:00
Paul Hauner
af2ba7eebf
Fix clippy lint in MemoryDB 2018-09-22 11:13:10 +10:00
Paul Hauner
2c2d270f5c
Merge branch 'master' into validate_block 2018-09-22 08:18:43 +10:00
Paul Hauner
616cc616db
Fix some clippy lints 2018-09-22 08:17:31 +10:00
Paul Hauner
091379f011
Replace env::dir with dirs crate 2018-09-22 07:45:40 +10:00
Paul Hauner
d00d109fa6
Update as per changes to SSZ
32-byte hashes are no longer prefixed with a length sequence.
2018-09-22 07:37:25 +10:00
Paul Hauner
f0b432d81c
Add ValidatorStore 2018-09-21 18:52:03 +10:00
Paul Hauner
8cbd4f47a0
Move BlockStore test across to MemoryDB 2018-09-21 15:02:28 +10:00
Paul Hauner
e6a693b89c
Add exists() function for MemoryDB 2018-09-21 15:02:00 +10:00
Paul Hauner
76f7922929
Merge branch 'master' into validate_block 2018-09-21 14:39:02 +10:00
Paul Hauner
f80d5ff0bd
Remove create_col from ClientDB trait 2018-09-21 14:12:53 +10:00
Paul Hauner
5b177a80b9
Add comments, fix warning in MemoryDB 2018-09-21 14:08:07 +10:00
Paul Hauner
66dc073c9b
Add basic memorydb implementation 2018-09-21 14:01:48 +10:00
Paul Hauner
51c842c236
Begin basics of block validation 2018-09-21 11:14:28 +10:00
Paul Hauner
d4e6f12ded
Add basic PoW chain db store 2018-09-21 11:13:07 +10:00
Paul Hauner
1065554216
Add BlockStore basics 2018-09-20 17:36:49 +10:00
Paul Hauner
f6330ce967
Add ClientDB exists() method 2018-09-20 17:36:23 +10:00
Paul Hauner
f64b8e30a1
Update SszBlock doc comments 2018-09-20 15:24:51 +10:00
Paul Hauner
43394c074c
Remove some dangling deps causing warnings 2018-09-20 15:17:34 +10:00
Paul Hauner
a4e61541aa
Add SszBlock test to check the canonical hash 2018-09-20 13:56:44 +10:00
Paul Hauner
2beeef8153
Add doc comments to SszBlock 2018-09-20 13:52:45 +10:00
Paul Hauner
55ce4998d8
Fix SszBlock bug relating to excess ssz
If you gave SszBlock too many bytes it would hash them too.
2018-09-20 13:51:58 +10:00
Paul Hauner
7020a08b7d
Finish SszBlock, add tests 2018-09-20 13:13:07 +10:00
Paul Hauner
a1b826906a
Fix SszBlock tests 2018-09-19 17:54:14 +10:00
Paul Hauner
1dd1714444
Half update some ssz indexes for ssz_block 2018-09-19 17:15:54 +10:00
Paul Hauner
ca951d0361
Move ssz block min length into block.rs, add tests 2018-09-19 16:57:21 +10:00
Paul Hauner
d0d336c341
Update AttestationRecord fields 2018-09-19 16:55:18 +10:00
Age
048f8b6f01
slight corrections to attestation validation 2018-09-19 16:29:29 +10:00
Age
7e1819f693
add helpers - implement get_block_hash 2018-09-19 16:27:19 +10:00
Age
27581c0ff4
Implement generalised error ParameterError 2018-09-19 16:25:39 +10:00
Paul Hauner
61fddb2660
Implement basics for ssz_block 2018-09-19 16:15:05 +10:00
Paul Hauner
3dea40abe0
Add temporary (incomplete) aggsig serialization
It just sets them to 64 zeros. This needs to be fixed.
2018-09-19 16:14:31 +10:00
Paul Hauner
4d9b53478f
Add SszBlock comment 2018-09-19 15:24:06 +10:00
Paul Hauner
fe2127ea31 Update SszBlock to use new SSZ API 2018-09-19 14:52:36 +10:00
Paul Hauner
718b9ed7de Move to blake2b, start adding validate_block fn 2018-09-19 14:46:58 +10:00
Paul Hauner
6c8c4d9b1e Move state/block.rs into own mod, add SszBlock 2018-09-19 14:45:55 +10:00
Paul Hauner
693d635f8c Add canonical hash function 2018-09-19 14:45:03 +10:00
Age
815180d88c
Adds assert_error macro 2018-09-19 14:00:35 +10:00
Paul Hauner
446e8ae53e Add doc comments to the db module 2018-09-18 17:40:07 +10:00
Paul Hauner
c077e8dbb9 Use different directory for rocksdb database 2018-09-18 17:39:50 +10:00
Paul Hauner
b6197ce04d Move db traits into own file 2018-09-18 17:39:38 +10:00
Paul Hauner
9b7463f68a Update ClientDB trait 2018-09-18 15:59:44 +10:00
Paul Hauner
3876c0261a Implement get and put on ClientDB trait 2018-09-18 10:27:29 +10:00
Paul Hauner
33b1e6ddf4 Partially implemented db wrapper
Addresses issue #12
2018-09-17 17:52:32 +10:00
Age
b8ca18f87b
correct attestation warnings, add unit test 2018-09-15 23:22:05 +10:00
Age
b6f4d1c968
add initial attestation validation structure 2018-09-15 22:53:45 +10:00
Paul Hauner
513972b75c Add more plumbing for block processing 2018-09-14 15:52:49 +10:00
Paul Hauner
ffaffbcd90 Change ssz to use extend_from_slice()
This is instead of `append` which empties the source vector. This
doens't really ssem suitable for what we're doing.
2018-09-10 08:52:21 +02:00
Paul Hauner
cbaee765e3 Update ssz for Block 2018-09-10 07:51:57 +02:00
Paul Hauner
976e3a717e Add ssz for AttestationRecord 2018-09-10 07:51:44 +02:00
Paul Hauner
3399b02393 Expand sync works 2018-09-09 18:28:36 +02:00
Paul Hauner
c33d3689a7 Begin sync framework 2018-09-09 16:36:00 +02:00
Paul Hauner
b4ca8cbde8 Remove get_new_shuffling
I am not sure it is designed correctly
2018-08-31 02:20:10 +10:00
Paul Hauner
2277273caa Fix get_new_shuffling, add functioning test. 2018-08-29 16:57:25 +10:00
Paul Hauner
c1a0df8c17 Implement get_new_shuffling w/o tests 2018-08-28 17:51:57 +10:00
Paul Hauner
d57f86c9ad Add readme for shuffling 2018-08-28 17:51:23 +10:00
Paul Hauner
133769e6e5 Expose function directly in transition 2018-08-24 16:01:57 +10:00
Paul Hauner
6f08700ea0 Move shuffling mod into state/transition 2018-08-24 16:01:24 +10:00
Paul Hauner
1a00f5b429 Rename helpers -> attestation_parent_hashes 2018-08-24 15:48:43 +10:00
Paul Hauner
d0c020db9d Rename "get_signed_parent_hashes" 2018-08-24 15:41:00 +10:00
Paul Hauner
1a3da944e5 Add comment to get_signed_parent_hashes 2018-08-24 15:36:26 +10:00
Paul Hauner
4ec0de6f5e Use borrows for get_signed_parent_hases, add tests 2018-08-24 15:26:27 +10:00
Paul Hauner
859c48d5e5 Progress on parent hash selection. Add test. 2018-08-24 14:33:05 +10:00
Paul Hauner
8ba7601ab3 Add get_signed_parent_hashes (untested) 2018-08-23 18:32:18 +10:00
Paul Hauner
c4f9f927f3 Rename "state" to "chain_state" 2018-08-23 18:31:58 +10:00
Paul Hauner
fd1eea561e Move boolean_bitfield into own crate 2018-08-23 15:20:10 +10:00
Paul Hauner
9808d5c209 Clear out old state config 2018-08-23 15:12:50 +10:00
Paul Hauner
abefec8ed8 Tidy "sync" module 2018-08-23 15:11:59 +10:00
Paul Hauner
366dca710f Tidy config struct 2018-08-23 15:11:15 +10:00
Paul Hauner
121bff725e Tidy client struct 2018-08-23 15:11:02 +10:00
Paul Hauner
9689142883 Add "Client" concept and RocksDB 2018-08-16 14:17:28 +10:00
Paul Hauner
3372583c18 Rename "src/" to "lighthouse/" 2018-08-15 13:41:16 +10:00