Commit Graph

32 Commits

Author SHA1 Message Date
Michael Sproul
371e5adcf8 Update to Spec v0.10 (#817)
* Start updating types

* WIP

* Signature hacking

* Existing EF tests passing with fake_crypto

* Updates

* Delete outdated API spec

* The refactor continues

* It compiles

* WIP test fixes

* All release tests passing bar genesis state parsing

* Update and test YamlConfig

* Update to spec v0.10 compatible BLS

* Updates to BLS EF tests

* Add EF test for AggregateVerify

And delete unused hash2curve tests for uncompressed points

* Update EF tests to v0.10.1

* Use optional block root correctly in block proc

* Use genesis fork in deposit domain. All tests pass

* Cargo fmt

* Fast aggregate verify test

* Update REST API docs

* Cargo fmt

* Fix unused import

* Bump spec tags to v0.10.1

* Add `seconds_per_eth1_block` to chainspec

* Update to timestamp based eth1 voting scheme

* Return None from `get_votes_to_consider` if block cache is empty

* Handle overflows in `is_candidate_block`

* Revert to failing tests

* Fix eth1 data sets test

* Choose default vote according to spec

* Fix collect_valid_votes tests

* Fix `get_votes_to_consider` to choose all eligible blocks

* Uncomment winning_vote tests

* Add comments; remove unused code

* Reduce seconds_per_eth1_block for simulation

* Addressed review comments

* Add test for default vote case

* Fix logs

* Remove unused functions

* Meter default eth1 votes

* Fix comments

* Address review comments; remove unused dependency

* Disable/delete two outdated tests

* Bump eth1 default vote warn to error

* Delete outdated eth1 test

Co-authored-by: Pawan Dhananjay <pawandhananjay@gmail.com>
2020-02-11 10:19:36 +11:00
Paul Hauner
75efed305c Faster BeaconState enc/dec (#671)
* Add state enc/dec benches

* Add example for flamegraph

* Use `PublicKeyBytes` for `Validator`

* Ripple PublicKeyBytes change through codebase

* Add benches, optimizations to store BeaconState

* Store BeaconState in StorageContainer too

* Optimize StorageContainer with std::mem magic

* Fix rest_api tests
2019-12-06 16:44:03 +11:00
Paul Hauner
bcffe42712 Bulk signature verification (#507)
* Add basic block processing benches

* Start reviving state processing benches

* Fix old block builders

* Add optimization for faster pubkey add

* Tidy benches, add another

* Add extra block processing bench

* Start working on faster BLS scheme

* Add partially complete sig verify optimization

* Add .gitignore to state processing

* Add progress on faster signature verification

* Fix SignatureSet for fake_crypto

* Tidy attester slashings sig set

* Tidy bulk signature verifier

* Refactor signature sets to be cleaner

* Start threading SignatureStrategy through code

* Add (empty) test dir

* Move BenchingBlockBuilder

* Add initial block signature verification tests

* Add tests for bulk signature verification

* Start threading SignatureStrategy in block proc.

* Refactor per_block_processing errors

* Use sig set tuples instead of lists of two

* Remove dead code

* Thread VerifySignatures through per_block_processing

* Add bulk signature verification

* Introduce parallel bulk signature verification

* Expand state processing benches

* Fix additional compile errors

* Fix issue where par iter chunks is 0

* Update milagro_bls dep

* Remove debugs, code fragment in beacon chain

* Tidy, add comments to block sig verifier

* Fix various PR comments

* Add block_root option to per_block_processing

* Fix comment in block signature verifier

* Fix comments from PR review

* Remove old comment

* Fix comment
2019-08-29 11:34:25 +10:00
Paul Hauner
8cfa36fedd Publish ssz_types (and deps) to crates.io (#468)
* Rename `hashing` crate to `eth2_hashing`

* Add license, desc to eth2_hashing Cargo.toml

* Remove merkle root from eth2 hashing

* Remove old benches folder (zombied from old branch)

* Add docs to eth2_hashing

* Prepare tree_hash for publishing on crates.io

* Update deps to use crates.io instead of paths

* Update all crates to pull ssz from crates.io

* Remove cached_tree_hash, add patches to manifest

* Fix compile error in benches

* Remove unused code

* Fix fake_crypto compile error
2019-08-08 11:39:47 +10:00
blacktemplar
01054ecf2f Use SignatureBytes and PublicKeyBytes for deposits (#472)
* Replace deposit signatures with SignatureBytes, a struct which lazyly parsers signatures only on demand.

* check byte length when parsing SignatureBytes

* add comment to struct

* distinguish BadSignature and BadSignatureBytes in verify_deposit_signature

* add test for valid signature

* Implements TryInto<Signature> for &SignatureBytes and From<Signature> for &SignatureBytes

* add and use PublicKeyBytes + fix formatting

* fix compiler warning + docs for macro generated structs

* adds tests to ensure correct byte lengths

* small style improvement as suggested by michaelsproul
2019-08-06 13:49:11 +10:00
Michael Sproul
a3a941efdf Merge remote-tracking branch 'origin/master' into v0.6.1 2019-06-03 16:31:34 +10:00
Paul Hauner
10a7936c37 Update BLS library 2019-06-03 13:26:22 +10:00
Kirk Baird
4f6447a62b Begin working on bls test 2019-05-21 10:32:14 +10:00
Paul Hauner
d73e068686 Add additional fake_crypto objects 2019-05-14 22:09:57 +10:00
Paul Hauner
5550d14d62 Upgrade BLS to new SSZ 2019-05-06 15:03:20 +10:00
Michael Sproul
71a0fed8eb testing: add a fake_crypto feature 2019-04-17 12:00:22 +10:00
Kirk Baird
023b4e8c92 Merge master and remove ssz length encoding from FakeBLS 2019-03-29 11:47:22 +11:00
Kirk Baird
fd2f9d0d15 Remove ssz encoding of length from; Signature, AggregateSiganture, PublicKey, SecretKey 2019-03-26 16:45:25 +11:00
Kirk Baird
864ef137ef Merge ssz little endian branch 2019-03-26 15:44:01 +11:00
Kirk Baird
d76baa1cc1 Allow downloading of large tests from EF github and fix issues with serde 2019-03-25 18:02:37 +11:00
Paul Hauner
7cbee46227 Add FakeSignature and FakeAggregateSignature
They replace Signature and FakeAggregateSignature when compling with
debug. Compiling with release uses the real structs.
2019-03-22 10:08:40 +11:00
Paul Hauner
e81f1c31c9 Fix proof-of-possession issues.
These were introduced in an earlier commit
2019-03-11 19:47:33 +11:00
Kirk Baird
25b08f0096 Run cargo fmt 2019-03-11 15:22:15 +11:00
Kirk Baird
191759dad0 Modify create_proof_of_possession, and verifying proof_of_possession in process_deposits 2019-03-11 15:18:45 +11:00
Kirk Baird
df52669888 Add changes of create_proof_of_possession to pull 2019-03-11 11:55:09 +11:00
Paul Hauner
3b6431b4b4 Impl serde ser and deser for bls keypairs 2019-03-08 13:15:41 +11:00
Paul Hauner
15e4aabd8a Add deposit processing, fix clippy lints 2019-03-07 16:15:38 +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
Kirk Baird
f72b45147a Merge conflicts from master 2019-02-25 10:36:54 +11:00
Kirk Baird
21d75f1853 Use verify_proof_of_possession 2019-02-18 12:06:47 +11:00
Kirk Baird
9c4a1f1d1f Update to signature-scheme 0.5.2 2019-02-18 10:50:40 +11:00
Kirk Baird
977f3edfb6 Add domain to all signature funcitons, modify validate_proof_of_possession() 2019-02-15 13:58:14 +11:00
Paul Hauner
35c914baa6 Revert "Merge pull request #200 from sigp/new-structure"
This reverts commit d7a3545be1, reversing
changes made to 1da06c156c.
2019-02-14 12:09:18 +11:00
Paul Hauner
1d5ff4359a Strip out old code
All of these files have been moved to either:

- https://github.com/sigp/lighthouse-beacon
- https://github.com/sigp/lighthouse-validator
- https://github.com/sigp/lighthouse-common

For rationale, see: https://github.com/sigp/lighthouse/issues/197
2019-02-13 14:15:53 +11:00
Paul Hauner
fd47f6c433 Move attestation validator to BeaconState fn 2019-01-27 17:54:26 +11:00
Paul Hauner
f9acc42aca Rename canonical_hash to `hash 2019-01-25 17:40:22 +11:00
Paul Hauner
e16f9e0aec Rename beacon_chain/ -> eth2/ 2019-01-22 16:16:02 +11:00