Commit Graph

40 Commits

Author SHA1 Message Date
Michael Sproul
a236003a7b Update to frozen spec ❄️ (v0.8.1) (#444)
* types: first updates for v0.8

* state_processing: epoch processing v0.8.0

* state_processing: block processing v0.8.0

* tree_hash_derive: support generics in SignedRoot

* types v0.8: update to use ssz_types

* state_processing v0.8: use ssz_types

* ssz_types: add bitwise methods and from_elem

* types: fix v0.8 FIXMEs

* ssz_types: add bitfield shift_up

* ssz_types: iterators and DerefMut for VariableList

* types,state_processing: use VariableList

* ssz_types: fix BitVector Decode impl

Fixed a typo in the implementation of ssz::Decode for BitVector, which caused it
to be considered variable length!

* types: fix test modules for v0.8 update

* types: remove slow type-level arithmetic

* state_processing: fix tests for v0.8

* op_pool: update for v0.8

* ssz_types: Bitfield difference length-independent

Allow computing the difference of two bitfields of different lengths.

* Implement compact committee support

* epoch_processing: committee & active index roots

* state_processing: genesis state builder v0.8

* state_processing: implement v0.8.1

* Further improve tree_hash

* Strip examples, tests from cached_tree_hash

* Update TreeHash, un-impl CachedTreeHash

* Update bitfield TreeHash, un-impl CachedTreeHash

* Update FixedLenVec TreeHash, unimpl CachedTreeHash

* Update update tree_hash_derive for new TreeHash

* Fix TreeHash, un-impl CachedTreeHash for ssz_types

* Remove fixed_len_vec, ssz benches

SSZ benches relied upon fixed_len_vec -- it is easier to just delete
them and rebuild them later (when necessary)

* Remove boolean_bitfield crate

* Fix fake_crypto BLS compile errors

* Update ef_tests for new v.8 type params

* Update ef_tests submodule to v0.8.1 tag

* Make fixes to support parsing ssz ef_tests

* `compact_committee...` to `compact_committees...`

* Derive more traits for `CompactCommittee`

* Flip bitfield byte-endianness

* Fix tree_hash for bitfields

* Modify CLI output for ef_tests

* Bump ssz crate version

* Update ssz_types doc comment

* Del cached tree hash tests from ssz_static tests

* Tidy SSZ dependencies

* Rename ssz_types crate to eth2_ssz_types

* validator_client: update for v0.8

* ssz_types: update union/difference for bit order swap

* beacon_node: update for v0.8, EthSpec

* types: disable cached tree hash, update min spec

* state_processing: fix slot bug in committee update

* tests: temporarily disable fork choice harness test

See #447

* committee cache: prevent out-of-bounds access

In the case where we tried to access the committee of a shard that didn't have a committee in the
current epoch, we were accessing elements beyond the end of the shuffling vector and panicking! This
commit adds a check to make the failure safe and explicit.

* fix bug in get_indexed_attestation and simplify

There was a bug in our implementation of get_indexed_attestation whereby
incorrect "committee indices" were used to index into the custody bitfield. The
bug was only observable in the case where some bits of the custody bitfield were
set to 1. The implementation has been simplified to remove the bug, and a test
added.

* state_proc: workaround for compact committees bug

https://github.com/ethereum/eth2.0-specs/issues/1315

* v0.8: updates to make the EF tests pass

* Remove redundant max operation checks.
* Always supply both messages when checking attestation signatures -- allowing
  verification of an attestation with no signatures.
* Swap the order of the fork and domain constant in `get_domain`, to match
  the spec.

* rustfmt

* ef_tests: add new epoch processing tests

* Integrate v0.8 into master (compiles)

* Remove unused crates, fix clippy lints

* Replace v0.6.3 tags w/ v0.8.1

* Remove old comment

* Ensure lmd ghost tests only run in release

* Update readme
2019-07-30 12:44:51 +10:00
Paul Hauner
177df12149
Testnet stability (#451)
* Change reduced tree for adding weightless node

* Add more comments for reduced tree fork choice

* Small refactor on reduced tree for readability

* Move test_harness forking logic into itself

* Add new `AncestorIter` trait to store

* Add unfinished tests to fork choice

* Make `beacon_state.genesis_block_root` public

* Add failing lmd_ghost fork choice tests

* Extend fork_choice tests, create failing test

* Implement Debug for generic ReducedTree

* Add lazy_static to fork choice tests

* Add verify_integrity fn to reduced tree

* Fix bugs in reduced tree

* Ensure all reduced tree tests verify integrity

* Slightly alter reduce tree test params

* Add (failing) reduced tree test

* Fix bug in fork choice

Iter ancestors was not working well with skip slots

* Put maximum depth for common ancestor search

Ensures that we don't search back past the finalized root.

* Add basic finalization tests for reduced tree

* Change fork choice to use beacon_block_root

Previously it was using target_root, which was wrong

* Change reduced tree for adding weightless node

* Add more comments for reduced tree fork choice

* Small refactor on reduced tree for readability

* Move test_harness forking logic into itself

* Add new `AncestorIter` trait to store

* Add unfinished tests to fork choice

* Make `beacon_state.genesis_block_root` public

* Add failing lmd_ghost fork choice tests

* Extend fork_choice tests, create failing test

* Implement Debug for generic ReducedTree

* Add lazy_static to fork choice tests

* Add verify_integrity fn to reduced tree

* Fix bugs in reduced tree

* Ensure all reduced tree tests verify integrity

* Slightly alter reduce tree test params

* Add (failing) reduced tree test

* Fix bug in fork choice

Iter ancestors was not working well with skip slots

* Put maximum depth for common ancestor search

Ensures that we don't search back past the finalized root.

* Add basic finalization tests for reduced tree

* Add network dir CLI flag

* Simplify "NewSlot" log message

* Rename network-dir CLI flag

* Change fork choice to use beacon_block_root

Previously it was using target_root, which was wrong

* Update db dir size for metrics

* Change slog to use `FullFormat` logging

* Update some comments and log formatting

* Add prom gauge for best block root

* Only add known target blocks to fork choice

* Add finalized and justified root prom metrics

* Add CLI flag for setting log level

* Add logger to beacon chain

* Add debug-level CLI flag to validator

* Allow block processing if fork choice fails

* Create warn log when there's low libp2p peer count

* Minor change to logging

* Make ancestor iter return option

* Disable fork choice test when !debug_assertions

* Fix type, removed code fragment

* Tidy some borrow-checker evading

* Lower reduced tree random test iterations
2019-07-29 13:45:45 +10:00
Kirk Baird
0513559252 Fix syncing bugs by recursively attempting to process parents in the … (#429)
* Fix syncing bugs by recursively attempting to process parents in the import queue, change BlockRootsIterator

* Swap from crossbeam channel to tokio mpsc

* Recursion fix

* Remove exess block processing

* Fix network lag, correct attestation topic

* Correct network poll logic

* Overhaul of SimpleSync and modify BlockRootsIterator to return start_slot

* Fix bug in tests relating to StateRootsIterator

* Remove old, commented-out heartbeat code.

* Tidy docs on import queue enum

* Change source logging msg in simple sync

* Rename function parameter in simple sync

* Use `BestBlockRootsIterator` in `reduced_tree`

* Update comments for `BestBlockRootsIterator`

* Fix duplicate dep in cargo.toml
2019-07-16 17:28:15 +10:00
Kirk Baird
08069704c1
Add cli flag for logging to JSON file 2019-07-10 10:27:44 +10:00
Age Manning
1aeec12b78
Improve error handling of default directory 2019-07-04 14:14:27 +10:00
Age Manning
af28d5e20c
Add persistent network identification 2019-07-04 14:14:27 +10:00
Age Manning
0952a36a21
Initial integration of discovery v5 2019-07-04 14:14:27 +10:00
Age Manning
44c9058477
Integrate discv5 into lighthouse 2019-07-04 14:14:27 +10:00
Age Manning
6ee2b4df34
Complete merging of network addition branch 2019-07-04 14:14:26 +10:00
Age Manning
d2f80e3b2a
Adds env logger to output libp2p logs 2019-07-04 14:11:17 +10:00
Age Manning
e36fa3152d
Adds verbosity cli flag 2019-07-04 14:11:17 +10:00
Paul Hauner
a9284bec18
Fix type in default confi filename 2019-06-09 06:41:51 -04:00
Paul Hauner
4a871dbcc7
Change default config filenames 2019-06-09 06:35:36 -04:00
Paul Hauner
a662c3a940
Fix various compile errors and warnings 2019-06-09 06:26:34 -04:00
Paul Hauner
ab12787610
Update account manager config parsing 2019-06-09 04:34:56 -04:00
Paul Hauner
3487b16ce5
Add eth2_config crate, integrate into val client 2019-06-08 20:21:50 -04:00
Paul Hauner
eb23b003b4
Ensure beacon node generates the right eth2 spec 2019-06-08 17:53:22 -04:00
Paul Hauner
d8fc5f31d8
Add Eth2Config to runtime 2019-06-08 13:17:03 -04:00
Paul Hauner
f69d9093a3
Add concept of beacon node configuration TOML 2019-06-07 21:00:34 -04:00
Paul Hauner
e73a31c37f
Refactor ClientConfig, add serde to it 2019-06-07 19:44:27 -04:00
Paul Hauner
3f27fd4edf
Parse http CLI args for HTTP server 2019-05-28 13:50:51 +10:00
Paul Hauner
b62f4477e1
More project-wide fixes for new DB 2019-05-21 17:45:35 +10:00
Paul Hauner
05df7702d3
Merge branch 'master' into disk-db 2019-04-30 16:02:23 +10:00
Age Manning
3f160d3b99
Correct bootnodes cli parameter 2019-04-01 16:29:11 +11:00
Age Manning
9f8850d0a1
Adds bootnode CLI parameter 2019-04-01 12:14:44 +11:00
Paul Hauner
08b1808745
Modify runtime to allow memory or disk db
DiskDB is not working yet, but we'll get there!
2019-03-31 18:57:48 +11:00
Age Manning
4be2eeb792
Correct cli rpc parameters 2019-03-20 09:58:31 +11:00
Age Manning
037c3b8307
Update config and cli for rpc 2019-03-20 00:01:31 +11:00
Age Manning
e7f87112fb
Tidy networking crates 2019-03-19 22:53:51 +11:00
Age Manning
2e020a3efa
Implement the basic structure of the beacon node. 2019-03-03 18:28:12 +11:00
Age Manning
19a64f906e
Initial beacon node setup.
- Add network crate.
- Add sync crate.
- Add version crate.
- Add lighthouse configuration.
- Add network configuration.
2019-02-28 10:29:28 +11:00
Age Manning
c7acde4fc2
Rename OptimisedLMDGhost to BitwiseLMDGhost. 2019-02-20 12:14:46 +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
9b14742e36
Update beacon_node bin to spec v0.2.0 2019-02-12 16:58:31 +11:00
Paul Hauner
ea523c8658
Merge spec crate into types 2019-01-25 13:52:21 +11:00
Paul Hauner
1256ba0d01
Implement very raw state transition logic 2019-01-23 19:25:05 +11:00
Paul Hauner
b555916808
Add slow LMD ghost implementation 2019-01-23 09:33:04 +11:00
Paul Hauner
eb4723fee5
Add sleep to beacon_node run loop 2019-01-22 15:18:02 +11:00
Paul Hauner
40cf650563
Add validator_node, restructure binaries, gRPC.
This is a massive commit which restructures the workspace, adds a very
basic, untested, validator client and some very basic, non-functioning
gRPC endpoints to the beacon-node.
2019-01-14 12:55:55 +11:00