Commit Graph

421 Commits

Author SHA1 Message Date
Paul Hauner
f8ec1e0cfa
Add slashings and attestations to per block benching 2019-03-09 18:56:01 +11:00
Paul Hauner
73ebb4bc2e
Add incomplete per-block processing benchmarks
Still needs to fill block with operations
2019-03-09 14:11:49 +11:00
mjkeating
7db2b51876 ran cargo fmt 2019-03-08 16:37:01 -08:00
Paul Hauner
ca5d9658ce
Move epoch processing benches into separate file 2019-03-09 10:45:28 +11:00
Paul Hauner
63743a962c
Add per-epoch benchmarks, optimise function. 2019-03-09 10:38:53 +11:00
mjkeating
d4f3bab68d Updated TreeHash logic as per revised spec 2019-03-08 15:24:07 -08:00
Paul Hauner
ddac7540bc
Allow test_harness to load validators from file. 2019-03-08 16:10:21 +11:00
Paul Hauner
4b21252ce4
Refactor BeaconChain and BeaconState genesis
Now it more easily supports using pre-build validator registries.
2019-03-08 15:33:45 +11:00
Paul Hauner
5c1458ba46
Add bls serde_vistors file 2019-03-08 13:19:37 +11:00
Paul Hauner
2f484db82c
Expose Signature in types crate 2019-03-08 13:16:33 +11:00
Paul Hauner
7ddbdc15bb
Impl serde deser for types::Deposit 2019-03-08 13:16:18 +11:00
Paul Hauner
3b6431b4b4
Impl serde ser and deser for bls keypairs 2019-03-08 13:15:41 +11:00
Paul Hauner
f479beb87e
Implement deposit merkle root verification.
It is currently disabled, but it's there for later.
2019-03-08 09:26:03 +11:00
Kirk Baird
08b803b6e7
Modifications to fuzz tests 2019-03-07 17:50:00 +11:00
Paul Hauner
1ef2652cac
Add transfer processing to BeaconChain 2019-03-07 17:23:11 +11:00
Paul Hauner
15e4aabd8a
Add deposit processing, fix clippy lints 2019-03-07 16:15:38 +11:00
Paul Hauner
195cb16a41
Update test_harness for spec v0.4.0 2019-03-07 14:29:21 +11:00
Paul Hauner
db3b6cba6d
Introduce Fork struct to block_producer
It's a pretty crappy solution, IMO. It shouldn't really belong in
"duties" but this gets the job done for now.
2019-03-07 13:54:56 +11:00
Paul Hauner
20ac1bf1f0
Remove unused files
They were accidentally introduced by a merge
2019-03-07 13:53:17 +11:00
Paul Hauner
5a21e19a31
Fix all compile errors from v0.4.0 update 2019-03-07 12:53:15 +11:00
Paul Hauner
e448882102
Re-add canonical_root methods to block & state
Turns out they were pretty useful
2019-03-07 12:25:00 +11:00
Paul Hauner
dad140a338
Fix attester and proposer compile issues
- Updated to use new signed roots (`SignedRoot`, `TreeHash`)
- Added a temporary domain value

Note: these changes are not a fully v0.4.0 upgrade.
2019-03-07 12:11:17 +11:00
Paul Hauner
93ce7b59e7
Merge branch 'master' into v0.4.0-types 2019-03-07 12:03:27 +11:00
Paul Hauner
e6526c9895
Refactor winning root logic 2019-03-07 11:32:53 +11:00
Paul Hauner
c8417ae009
Merge pull request #284 from michaelsproul/merkle-proofs
Implement library for verifying Merkle proofs
2019-03-07 12:30:04 +13:00
Paul Hauner
5a225d2983
Update per-slot processing to v0.4.0 2019-03-07 08:37:13 +11:00
Paul Hauner
8a25fd48cf
Fix per_epoch_processing so it compiles again 2019-03-06 18:57:41 +11:00
Paul Hauner
17210faf3a
Start reorg of per_epoch_processing 2019-03-06 17:14:54 +11:00
Paul Hauner
521d48d37c
Break per-block-processing into smaller fns
Will enable benchmarking of each individual fn
2019-03-06 17:03:18 +11:00
Michael Sproul
7bb5e1c151
Implement library for verifying Merkle proofs. 2019-03-06 16:59:36 +11:00
Paul Hauner
599948b26b
Add comments to block_processing code 2019-03-06 16:24:56 +11:00
Paul Hauner
40f74c9b26
First compiling version of per-block-proc refactor 2019-03-06 15:22:45 +11:00
Paul Hauner
a15ed0acd3
Start new Error structure in state_processing 2019-03-06 10:22:19 +11:00
Paul Hauner
0be8e57fd3
Further v0.4.0 updates to types crate 2019-03-06 10:21:55 +11:00
Michael Sproul
6253167cac
Update ethereum-types to 0.5 2019-03-06 10:08:35 +11:00
Paul Hauner
96ec53c6a8
Update beacon_state.rs to spec v0.4.0 2019-03-05 18:22:37 +11:00
Paul Hauner
38a1b94f61
Fix compile issues in types crate 2019-03-05 17:38:17 +11:00
Paul Hauner
e0ccde1ce3
Remove unused function from @agemanning 2019-03-05 17:37:09 +11:00
Michael Sproul
33a3161905
Remove SSZ round-trip test duplication
Closes #244
2019-03-05 17:29:08 +11:00
Michael Sproul
d519bc1388
Use cfg(test) for test macros 2019-03-05 17:29:08 +11:00
Paul Hauner
0f7d2c168c
Fix compile errors in beacon_state.rs 2019-03-05 17:19:36 +11:00
Paul Hauner
262e9cf0bc
Additional spec updates 2019-03-05 09:51:29 +11:00
Paul Hauner
663d39739f
Do project-wide s/epoch_length/slots_per_epoch/g 2019-03-04 17:51:54 +11:00
Paul Hauner
a1af65ce1a
Update ChainSpec to v0.4.0 2019-03-04 17:48:19 +11:00
Paul Hauner
7f10d41121
Remove old spec types
They have been made obsolete
2019-03-04 17:17:07 +11:00
Paul Hauner
9769ca4665
Update all struct definitions
Does not compile
2019-03-04 17:13:50 +11:00
Paul Hauner
94122a7334
Add SignedRoot methods 2019-03-04 15:47:48 +11:00
Paul Hauner
4a57aec472
Unfinished progress 2019-03-04 14:24:29 +11:00
Paul Hauner
5073ac7a98
Merge branch 'master' into test_harness_exits 2019-03-04 14:01:03 +11:00
Age Manning
0e1a14a628
Merge pull request #264 from sigp/yaml-chain-tests
YAML-defined test_harness routines
2019-03-04 13:19:25 +11:00
Paul Hauner
ef006bfb2c
Add Exit support to test_harness 2019-03-04 12:21:24 +11:00
Paul Hauner
ef549aa38b
Merge pull request #273 from mjkeating/tree_hash_container_fix
Brought algorithm in TreeHash macro up to spec
2019-03-03 20:01:47 +13:00
Paul Hauner
ec0e13b764
Add comments to new functions 2019-03-03 15:32:44 +11:00
Age Manning
60cfdf6e55
Convert bitwise ghost to use u64 block heights. 2019-03-03 13:35:15 +11:00
Paul Hauner
ede5685bc2
Fix warnings and clippy lints 2019-03-03 11:47:09 +11:00
Paul Hauner
76a0ba2d6c
Add attester slashing support to block processing
At spec v0.2.0
2019-03-03 11:18:12 +11:00
Paul Hauner
59128f842a
Add verify_slashable_attestation spec method
As per v0.2.0 spec
2019-03-03 11:16:59 +11:00
Paul Hauner
3561d44cbe
Update per-block processing for new AggPub wrapper
AggregatePublicKey newtype was introduced in previous commit
2019-03-03 11:12:18 +11:00
Paul Hauner
35ae1b6745
Add agg_pub to bls, add agg_sig.verify_multiple
- Adds a new-type wrapper for `AggregatePublicKey`, just like all the
other types.
- Adds the `verify_multiple` method to the `AggregateSignature` newtype,
as was introduced in a recent version of signature-schemes.
2019-03-03 11:10:38 +11:00
mjkeating
8a768819b0 brought algorithm in TreeHash macro to spec 2019-03-02 09:59:01 -08:00
Paul Hauner
e2dd753f05
Merge branch 'master' into yaml-chain-tests 2019-03-02 20:18:09 +11:00
Paul Hauner
4db2f082e1
Add state-checks to test_harness YAML
Runs tests against a state at some slot
2019-03-02 20:17:14 +11:00
Paul Hauner
c975d49ead
Copy SlashableVote.. tests to SlashableAttestation
SlashableVoteData tests were just copied directly across
2019-03-02 18:39:52 +11:00
Paul Hauner
8e1380d7c4
Add ProposerSlashingBuilder
It is capable of producing double votes
2019-03-02 18:36:44 +11:00
Paul Hauner
bb4d392a98
Add AttestationSlashingBuilder 2019-03-02 16:05:45 +11:00
Michael Sproul
6795aa42b2 Fix log_int implementation, removing floats
The cast from f32::MAX to u32 was undefined behaviour, and the use of floating
point logarithms would yield incorrect results due to rounding and truncation,
e.g. for the integer 16777206
2019-03-02 15:52:33 +11:00
Paul Hauner
f3a3cfcc45
Add surround/dbl vote fns to SlashableAttestation
Copied from `SlashableVoteData`
2019-03-02 15:33:52 +11:00
Paul Hauner
22d59a70cc
Add debug message when validator is penalized 2019-03-02 11:27:12 +11:00
Paul Hauner
867dce34cd
Remove domain constants from block_processable
The information is gather from the `spec` object, not the constants.
2019-03-02 11:26:39 +11:00
Paul Hauner
1097c8089b
Add naive deposit-handling to BeaconChain 2019-03-01 16:56:27 +11:00
Paul Hauner
8671c5790c
Merge pull request #268 from sigp/fork-choice-corrections
Correct bitwise fork-choice rule.
2019-03-01 18:34:44 +13:00
Age Manning
c1f8ebeca1
Merge pull request #266 from sigp/faster-swap-or-not
Faster swap-or-not for full list shuffles.
2019-03-01 15:45:20 +11:00
Age Manning
13c957bef7
Correct bitwise fork-choice rule. 2019-03-01 14:38:07 +11:00
Paul Hauner
fe7c475207
Merge pull request #265 from sigp/more-readmes
Readme updates
2019-03-01 16:36:34 +13:00
Luke Anderson
3753782c40
Just some small gramatical improvements on READMEs 2019-03-01 13:10:50 +11:00
Paul Hauner
c3b2f802a7
Add fast full-list shuffle for swap-or-not
- Passes test vectors
- Implemented in beacon state
- Added more docs
2019-03-01 12:19:05 +11:00
Paul Hauner
8aa7f25bbc
Introduce faster swap-or-not whole-list shuffle 2019-03-01 01:47:40 +11:00
Paul Hauner
8842adb53b
Fix typos in READMEs 2019-03-01 00:25:11 +11:00
Paul Hauner
6fac35a7c5
Update main readme, add eth2/ readme 2019-03-01 00:18:53 +11:00
Paul Hauner
e0926dcd8d
Change log msgs in BeaconState
Make it louder when shuffling happens, also when deposits are being
processed.
2019-02-28 23:10:40 +11:00
Paul Hauner
7108d057fb
Set BeaconState to process deposits in parallel
Provides a large speed improvement.
2019-02-28 23:09:21 +11:00
Paul Hauner
073be906da
Remove cache operations from epoch processing.
- Don't build the next cache at all.
- Call `advance_caches()` in per-slot processing.
2019-02-28 16:37:12 +11:00
Age Manning
ed032dddea
Merge pull request #261 from sigp/epoch-benches
Move epoch benches to 16k validators
2019-02-27 12:39:31 +11:00
Age Manning
274458d41e
Merge pull request #260 from sigp/shuffle-bench
Add benchmarks to shuffling crates
2019-02-27 12:37:30 +11:00
Paul Hauner
04f179243e
Fix type in BeaconStateBuilder comments 2019-02-26 22:35:51 +13:00
Paul Hauner
c2fb095759
Add docstrings to BeaconStateBuilder 2019-02-26 22:34:41 +13:00
Paul Hauner
3ff8f6ebb3
Update epoch trans. tests to us 16,384 validators 2019-02-26 22:25:29 +13:00
Paul Hauner
af17fb1d03
Update BeaconStateBuilder API 2019-02-26 22:00:07 +13:00
Paul Hauner
5cfc9cb21d
Test state processing with and w/o caches 2019-02-26 20:18:59 +13:00
Paul Hauner
931da13545
Add drop_cache fn to BeaconState
Permits clearing an epoch cache.
2019-02-26 20:18:20 +13:00
Paul Hauner
f82c4268e2
Split BeaconState::genesis into two functions
This allows us to build a genesis state without inducting all the
validators. This will be a signigicant speed up for tests as we can
avoid generating keypairs and checking proof-of-possessions.
2019-02-26 20:16:14 +13:00
Paul Hauner
a8ebc0e19c
Add benchmarks for fisher_yates_shuffle 2019-02-26 19:32:32 +13:00
Paul Hauner
0fe3a81c9e
Add benches to swap_or_not_shuffle 2019-02-26 19:30:51 +13:00
Age Manning
d140563545
Merge pull request #259 from sigp/bench-epoch-trans
Add benching and test for epoch processing
2019-02-26 16:43:24 +11:00
Paul Hauner
65d303c500
Fix failing tests 2019-02-26 17:20:43 +13:00
Paul Hauner
e97b554485
Run rustfmt 2019-02-26 16:50:04 +13:00
Paul Hauner
9f846eda26
Fix clippy lint 2019-02-26 16:49:17 +13:00
Paul Hauner
906131f882
Add tests and benches for epoch processing 2019-02-26 16:27:42 +13:00
Paul Hauner
53663e54b5
Fix error with get_permutated_index.
Error types were modified. Error involved shuffling with the _value_of
active validator indicies, not an _index_.
2019-02-26 16:26:06 +13:00
Paul Hauner
59d6b1fdd0
Move BeaconStateBuilder out of test mods
This allows it to be accessed by other crates/tests.
2019-02-26 16:25:08 +13:00
thojest
6e8fc1b6d0 resolved merge conflicts due to Treehash macro implementation (lighthouse-246) 2019-02-25 23:20:24 +01:00
mjkeating
c688e37693 merged master 2019-02-25 09:46:49 -08:00
mjkeating
d7184345b8 renamed the macro Hashtree to TreeHash 2019-02-25 09:17:17 -08:00
thojest
9a892bbdfd removed TestRandom import in beacon_state (lighthouse-246) 2019-02-25 09:26:43 +01:00
thojest
cd4346962a Merge branch 'master' into lighthouse-246 2019-02-25 09:24:47 +01:00
mjkeating
2ce316235f merged master and resolved beacon_state conflict 2019-02-24 16:54:26 -08:00
Kirk Baird
3ae7d24d17 Merge branch 'master' into ssz-fuzzing 2019-02-25 10:49:51 +11:00
Kirk Baird
4c3b0a6575
Formatting 2019-02-25 10:38:04 +11:00
Kirk Baird
f72b45147a
Merge conflicts from master 2019-02-25 10:36:54 +11:00
Age Manning
27e7bbd72f
Fix typo in BeaconState
Co-Authored-By: paulhauner <paul@paulhauner.com>
2019-02-25 08:35:21 +13:00
Paul Hauner
5ca7c9929a
Merge branch 'master' into beacon-state-caching 2019-02-24 19:14:05 +13:00
Paul Hauner
ab10cbbdb5
Fix clippy lints, small typos 2019-02-24 18:52:12 +13:00
Paul Hauner
c49f425fe8
Tidy, add comments to BeaconState 2019-02-24 18:25:17 +13:00
Paul Hauner
779b6266a5
Ensure shuffling is cached between slot calcs
Previously it was being re-built for every slot, now it is being
generated once-per-epoch.
2019-02-23 18:45:32 +13:00
Kirk Baird
a5cbda0b60 Merge branch 'master' into signature-scheme-update 2019-02-23 13:34:57 +11:00
mjkeating
f95a0134e6 now using the Hashtree macro for most struct types 2019-02-22 13:07:04 -08:00
thojest
66b5accdc2 replaced manual TestRandom implementation with macro when possible; fixed typo in TestRandom macro (lighthouse-246) 2019-02-22 17:10:26 +01:00
thojest
278b41c8ef decided against moving test_utils (lighthouse-246) 2019-02-22 16:05:52 +01:00
thojest
7a382043e1 added test_random_derive implementation (lighthouse-246) 2019-02-22 15:54:18 +01:00
thojest
5f3ba42b97 added first draft for lib-crates for test_random and test_random_derive (lighthouse-246) 2019-02-22 12:16:11 +01:00
Kirk Baird
ab1dc7bfce
Add simple fuzz tests for hashing and boolean-bitfield 2019-02-22 16:50:14 +11:00
Paul Hauner
7a28893bab
Fix bug in Epoch.slot_iter()
It wasn't running the whole range, plus it could get into a loop when
used near the u64::max_value
2019-02-22 18:48:35 +13:00
Paul Hauner
89ab0f683e
Change "few_validators" spec to be 8 shards.
A bug arises when the number of shards is less than the slots in an
epoch.
2019-02-22 18:19:47 +13:00
Paul Hauner
a5de6a1915
Add caching to BeaconState.
Removes CachingBeaconState
2019-02-22 18:14:16 +13:00
Paul Hauner
cdc03f1749
Remove FastBeaconState 2019-02-22 17:55:36 +13:00
Kirk Baird
fdbd9d4410 Merge branch 'master' into ssz-fuzzing 2019-02-22 15:26:28 +11:00
Paul Hauner
c040ed7b11
Merge pull request #243 from sigp/fork-choice-tests
Fork choice tests
2019-02-22 13:34:58 +13:00
Paul Hauner
b211e39331
Add progress on FastBeaconState 2019-02-21 19:00:55 +13:00
Kirk Baird
68017b66fd
Fuzzing for Vec<u8> 2019-02-21 14:23:21 +11:00
Kirk Baird
274bdd491d
Fuzz for address and Hash256 2019-02-21 13:43:09 +11:00
Kirk Baird
00e5b57166
Fuzz test ssz_encode and ssz_decode for usize 2019-02-20 16:43:30 +11:00
Kirk Baird
b98db3773e
Fuzz test ssz_encode for u8 to u64 2019-02-20 16:15:30 +11:00
Kirk Baird
d5c4771f0a
Fuzz test decodes from u8 to u64 2019-02-20 15:34:15 +11:00
Kirk Baird
38abcc4a24
Fuzz test for u8 fails 2019-02-20 15:03:32 +11:00
Kirk Baird
52347d8e6d
Write a fuzz test 2019-02-20 14:46:25 +11:00
Kirk Baird
3517ef6513
Initialise fuzzing for ssz 2019-02-20 14:16:07 +11:00
Kirk Baird
673c8ea388
Merge current master 2019-02-20 13:59:11 +11:00
Age Manning
efa8aa19e7
Corrects small comments. 2019-02-20 12:52:03 +11:00
Age Manning
0f7167992b
Removes topic from logs. 2019-02-20 12:39:00 +11:00
Age Manning
2fbdc53147
Add asserts to ensure block heights are not too large. 2019-02-20 12:36:54 +11:00
Age Manning
d8584cbed2
Update to rust 2018 importing macros. 2019-02-20 12:15:41 +11:00
Age Manning
c7acde4fc2
Rename OptimisedLMDGhost to BitwiseLMDGhost. 2019-02-20 12:14:46 +11:00
Paul Hauner
59fd716286
Add extra comment to ssz_derive 2019-02-20 11:23:35 +13:00
Paul Hauner
586bb09e02
Set ssz_derive to import from ssz::
Previously it was expecting `Encodable`, `Decodable`, etc to be in
scope, now it uses `ssz::Encodable`.
2019-02-20 11:06:03 +13:00
Paul Hauner
abef6698b1
Fix failing doc examples in ssz_derive 2019-02-20 10:12:18 +13:00
Age Manning
6f74ffc7e6
Correct minor comment. 2019-02-19 23:20:45 +11:00
Age Manning
b8411e7126
Merge branch 'master' into fork-choice-tests 2019-02-19 23:09:31 +11:00
Age Manning
fd1edaf805
Add fork choice bug fixes.
- Further bug fixes from testing.
- Simplify the testing framework.
- Add tests for longest chain and GHOST vs bitwise GHOST.
2019-02-19 23:06:35 +11:00
Paul Hauner
a78256c778
Merge branch 'master' into ssz-derive 2019-02-19 20:46:47 +13:00
Paul Hauner
5e67ddd498
Add docs to ssz_derive 2019-02-19 20:43:09 +13:00