Commit Graph

469 Commits

Author SHA1 Message Date
Paul Hauner
7edc5f37b9
Move BeaconChainHarness to interop spec 2019-09-04 10:25:30 +10:00
Paul Hauner
d80d9dba4c
Add flag for web3 server 2019-09-03 16:40:53 +10:00
Paul Hauner
29584ca087
Add docs to Eth1Chain 2019-09-03 15:56:11 +10:00
Paul Hauner
31557704eb
Add Eth1Chain member to BeaconChain 2019-09-03 15:52:25 +10:00
Paul Hauner
ab2b8accd4
Add first pass at Eth1Chain trait 2019-09-03 15:22:00 +10:00
Paul Hauner
1b4679e5bc
Improve block processing outcomes enum 2019-09-03 14:18:45 +10:00
Paul Hauner
969b6d7575
Tidy BeaconStateCow 2019-09-03 09:50:15 +10:00
Age Manning
cd7b6da88e
Updates syncing, corrects CLI variables 2019-09-03 00:34:41 +10:00
Paul Hauner
a0e019b4d7
Fix interop eth1 blockhash 2019-09-02 18:19:30 +10:00
Paul Hauner
70f4052b2e
Allow starting testnet from JSON state 2019-09-02 15:58:53 +10:00
Paul Hauner
11a1505784
Allow starting from SSZ genesis state 2019-09-02 15:07:32 +10:00
Paul Hauner
d4bf1390c9
Add interop eth1 data stub 2019-09-02 11:39:28 +10:00
Paul Hauner
6db1a19169
Remove stray dbg! 2019-09-01 22:20:31 +10:00
Paul Hauner
543e9457b7
Move bootstrapper into own crate 2019-09-01 19:32:57 +10:00
Paul Hauner
5f0509be50
Improve and extend CLI interface 2019-08-31 12:34:27 +10:00
Paul Hauner
9ffb6d0fe1
Fix fake_crypto test fails 2019-08-30 15:49:06 +10:00
Paul Hauner
6234adc0d6
Add interop-spec genesis procedure 2019-08-30 15:33:34 +10:00
Paul Hauner
3365106340
Fix bug with block production 2019-08-30 11:04:15 +10:00
Paul Hauner
ae114889c1
Fix bugs from removing speculative state 2019-08-30 00:24:46 +10:00
Paul Hauner
682081ef07
Add first pass at removing speculative state 2019-08-29 19:14:52 +10:00
Paul Hauner
29c8477242
Merge branch 'master' into interop 2019-08-29 16:00:22 +10:00
Paul Hauner
314780e634
Allow for customizable recent genesis window 2019-08-29 14:59:32 +10:00
Paul Hauner
8cfbe8bbfb
Change seconds_per_slot to milliseconds_per_slot 2019-08-29 14:32:21 +10:00
Paul Hauner
7d03806107
Upgrade codebase to new SlotClock API 2019-08-29 14:26:30 +10:00
Paul Hauner
4557d2c84b
Merge branch 'interop' into millsecond-slots 2019-08-29 13:27:06 +10:00
Paul Hauner
bcd53a8b10
Migrate codebase across to new SlotClock API 2019-08-29 13:25:55 +10: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
3207eb1d68
Merge branch 'interop' of github.com:sigp/lighthouse into interop 2019-08-27 11:20:35 +10:00
Paul Hauner
4e0ac0169b
Merge branch 'fix-fork-choice' into interop 2019-08-27 11:20:16 +10:00
Paul Hauner
ed6c39e25a
Add log for fork choice integrity in beacon chain 2019-08-27 11:19:50 +10:00
Paul Hauner
6875ae8af5
Pull Eth2Config during bootstrap 2019-08-27 00:04:15 +10:00
Paul Hauner
cf435d9653
Refactor beacon chain start code 2019-08-26 14:45:49 +10:00
Paul Hauner
0c3fdcd57c
Bootstrap (#501)
* Renamed fork_choice::process_attestation_from_block

* Processing attestation in fork choice

* Retrieving state from store and checking signature

* Looser check on beacon state validity.

* Cleaned up get_attestation_state

* Expanded fork choice api to provide latest validator message.

* Checking if the an attestation contains a latest message

* Correct process_attestation error handling.

* Copy paste error in comment fixed.

* Tidy ancestor iterators

* Getting attestation slot via helper method

* Refactored attestation creation in test utils

* Revert "Refactored attestation creation in test utils"

This reverts commit 4d277fe4239a7194758b18fb5c00dfe0b8231306.

* Integration tests for free attestation processing

* Implicit conflicts resolved.

* formatting

* Do first pass on Grants code

* Add another attestation processing test

* Tidy attestation processing

* Remove old code fragment

* Add non-compiling half finished changes

* Simplify, fix bugs, add tests for chain iters

* Remove attestation processing from op pool

* Fix bug with fork choice, tidy

* Fix overly restrictive check in fork choice.

* Ensure committee cache is build during attn proc

* Ignore unknown blocks at fork choice

* Various minor fixes

* Make fork choice write lock in to read lock

* Remove unused method

* Tidy comments

* Fix attestation prod. target roots change

* Fix compile error in store iters

* Reject any attestation prior to finalization

* Begin metrics refactor

* Move beacon_chain to new metrics structure.

* Make metrics not panic if already defined

* Use global prometheus gather at rest api

* Unify common metric fns into a crate

* Add heavy metering to block processing

* Remove hypen from prometheus metric name

* Add more beacon chain metrics

* Add beacon chain persistence metric

* Prune op pool on finalization

* Add extra prom beacon chain metrics

* Prefix BeaconChain metrics with "beacon_"

* Add more store metrics

* Add basic metrics to libp2p

* Add metrics to HTTP server

* Remove old `http_server` crate

* Update metrics names to be more like standard

* Fix broken beacon chain metrics, add slot clock metrics

* Add lighthouse_metrics gather fn

* Remove http args

* Fix wrong state given to op pool prune

* Make prom metric names more consistent

* Add more metrics, tidy existing metrics

* Fix store block read metrics

* Tidy attestation metrics

* Fix minor PR comments

* Fix minor PR comments

* Remove duplicated attestation finalization check

* Remove awkward `let` statement

* Add first attempts at HTTP bootstrap

* Add beacon_block methods to rest api

* Fix serde for block.body.grafitti

* Allow travis failures on beta (see desc)

There's a non-backward compatible change in `cargo fmt`. Stable and beta
do not agree.

* Add network routes to API

* Fix rustc warnings

* Add best_slot method

* Add --bootstrap arg to beacon node

* Get bootstrapper working for ENR address

* Store intermediate states during block processing

* Allow bootstrapper to scrape libp2p address

* Update bootstrapper libp2p address finding

* Add comments

* Tidy API to be more consistent with recent decisions

* Address some review comments

* Make BeaconChainTypes Send + Sync + 'static

* Add `/network/listen_port` API endpoint

* Abandon starting the node if libp2p doesn't start

* Update bootstrapper for API changes

* Remove unnecessary trait bounds
2019-08-23 15:53:53 +10:00
Paul Hauner
bb63d300f2
Merge branch 'bootstrap' into interop 2019-08-23 13:03:59 +10:00
Paul Hauner
a8de94ca13
Remove unnecessary trait bounds 2019-08-23 13:02:17 +10:00
Paul Hauner
112e323c1e
Merge branch 'bootstrap' into interop 2019-08-22 17:50:05 +10:00
Paul Hauner
11dc72a442
Start implementing BeaconChainBuilder 2019-08-22 17:48:13 +10:00
Paul Hauner
853344af8a
Make BeaconChainTypes Send + Sync + 'static 2019-08-22 16:34:21 +10:00
Paul Hauner
a6da933886
Merge branch 'master' into bootstrap 2019-08-21 14:16:19 +10:00
Paul Hauner
c4ced3e0d2
Fix block processing blowup, upgrade metrics (#500)
* Renamed fork_choice::process_attestation_from_block

* Processing attestation in fork choice

* Retrieving state from store and checking signature

* Looser check on beacon state validity.

* Cleaned up get_attestation_state

* Expanded fork choice api to provide latest validator message.

* Checking if the an attestation contains a latest message

* Correct process_attestation error handling.

* Copy paste error in comment fixed.

* Tidy ancestor iterators

* Getting attestation slot via helper method

* Refactored attestation creation in test utils

* Revert "Refactored attestation creation in test utils"

This reverts commit 4d277fe4239a7194758b18fb5c00dfe0b8231306.

* Integration tests for free attestation processing

* Implicit conflicts resolved.

* formatting

* Do first pass on Grants code

* Add another attestation processing test

* Tidy attestation processing

* Remove old code fragment

* Add non-compiling half finished changes

* Simplify, fix bugs, add tests for chain iters

* Remove attestation processing from op pool

* Fix bug with fork choice, tidy

* Fix overly restrictive check in fork choice.

* Ensure committee cache is build during attn proc

* Ignore unknown blocks at fork choice

* Various minor fixes

* Make fork choice write lock in to read lock

* Remove unused method

* Tidy comments

* Fix attestation prod. target roots change

* Fix compile error in store iters

* Reject any attestation prior to finalization

* Begin metrics refactor

* Move beacon_chain to new metrics structure.

* Make metrics not panic if already defined

* Use global prometheus gather at rest api

* Unify common metric fns into a crate

* Add heavy metering to block processing

* Remove hypen from prometheus metric name

* Add more beacon chain metrics

* Add beacon chain persistence metric

* Prune op pool on finalization

* Add extra prom beacon chain metrics

* Prefix BeaconChain metrics with "beacon_"

* Add more store metrics

* Add basic metrics to libp2p

* Add metrics to HTTP server

* Remove old `http_server` crate

* Update metrics names to be more like standard

* Fix broken beacon chain metrics, add slot clock metrics

* Add lighthouse_metrics gather fn

* Remove http args

* Fix wrong state given to op pool prune

* Make prom metric names more consistent

* Add more metrics, tidy existing metrics

* Fix store block read metrics

* Tidy attestation metrics

* Fix minor PR comments

* Allow travis failures on beta (see desc)

There's a non-backward compatible change in `cargo fmt`. Stable and beta
do not agree.

* Tidy `lighthouse_metrics` docs

* Fix typo
2019-08-19 21:02:34 +10:00
Paul Hauner
4678524659
Store intermediate states during block processing 2019-08-15 14:52:00 +10:00
Paul Hauner
072eb82fe4
Merge branch 'master' into block-processing-times 2019-08-14 12:25:28 +10:00
Paul Hauner
cd26a19a70
Attestation processing (#497)
* Renamed fork_choice::process_attestation_from_block

* Processing attestation in fork choice

* Retrieving state from store and checking signature

* Looser check on beacon state validity.

* Cleaned up get_attestation_state

* Expanded fork choice api to provide latest validator message.

* Checking if the an attestation contains a latest message

* Correct process_attestation error handling.

* Copy paste error in comment fixed.

* Tidy ancestor iterators

* Getting attestation slot via helper method

* Refactored attestation creation in test utils

* Revert "Refactored attestation creation in test utils"

This reverts commit 4d277fe4239a7194758b18fb5c00dfe0b8231306.

* Integration tests for free attestation processing

* Implicit conflicts resolved.

* formatting

* Do first pass on Grants code

* Add another attestation processing test

* Tidy attestation processing

* Remove old code fragment

* Add non-compiling half finished changes

* Simplify, fix bugs, add tests for chain iters

* Remove attestation processing from op pool

* Fix bug with fork choice, tidy

* Fix overly restrictive check in fork choice.

* Ensure committee cache is build during attn proc

* Ignore unknown blocks at fork choice

* Various minor fixes

* Make fork choice write lock in to read lock

* Remove unused method

* Tidy comments

* Fix attestation prod. target roots change

* Fix compile error in store iters

* Reject any attestation prior to finalization

* Fix minor PR comments

* Remove duplicated attestation finalization check

* Remove awkward `let` statement
2019-08-14 10:55:24 +10:00
Paul Hauner
b7e43b56f9
Fix minor PR comments 2019-08-13 19:37:14 +10:00
Paul Hauner
e410e89898
Merge branch 'block-processing-times' of github.com:sigp/lighthouse into block-processing-times 2019-08-13 18:26:07 +10:00
Paul Hauner
341a83b9e8
Tidy attestation metrics 2019-08-13 16:17:11 +10:00
Paul Hauner
b076b07022
Add more metrics, tidy existing metrics 2019-08-13 12:11:18 +10:00
Paul Hauner
e369e293a5
Make prom metric names more consistent 2019-08-13 09:20:39 +10:00
Paul Hauner
24b2f83713
Fix wrong state given to op pool prune 2019-08-13 07:35:52 +10:00
Paul Hauner
d7c546844c
Fix broken beacon chain metrics, add slot clock metrics 2019-08-12 17:44:47 +10:00
Paul Hauner
95a320817e
Update metrics names to be more like standard 2019-08-12 15:42:23 +10:00
Paul Hauner
913ee4694e
Prefix BeaconChain metrics with "beacon_" 2019-08-12 13:35:16 +10:00
Paul Hauner
7140dbc45d
Add extra prom beacon chain metrics 2019-08-12 13:26:58 +10:00
Paul Hauner
6150f0ae1a
Prune op pool on finalization 2019-08-11 18:29:11 +10:00
Paul Hauner
78db947e6e
Add beacon chain persistence metric 2019-08-11 18:28:57 +10:00
Paul Hauner
42d300bdc3
Add more beacon chain metrics 2019-08-11 17:49:32 +10:00
Paul Hauner
76f42ac7ff
Remove hypen from prometheus metric name 2019-08-11 16:15:26 +10:00
Paul Hauner
441eb41b6b
Add heavy metering to block processing 2019-08-11 15:53:34 +10:00
Paul Hauner
2108895fca
Unify common metric fns into a crate 2019-08-11 15:34:10 +10:00
Paul Hauner
36ff115b04
Use global prometheus gather at rest api 2019-08-11 14:46:20 +10:00
Paul Hauner
e33d0703ef
Make metrics not panic if already defined 2019-08-11 14:43:31 +10:00
Paul Hauner
9995b390b5
Move beacon_chain to new metrics structure. 2019-08-11 14:11:13 +10:00
Paul Hauner
48733917be
Begin metrics refactor 2019-08-11 12:12:19 +10:00
Paul Hauner
4020d13064
Reject any attestation prior to finalization 2019-08-11 09:34:49 +10:00
Paul Hauner
cd11eb15a5
Merge branch 'master' into attestation-processing 2019-08-11 09:08:26 +10:00
Paul Hauner
04bef689e3
Fix attestation prod. target roots change 2019-08-10 17:47:34 +10:00
Paul Hauner
963fb7bc87
Tidy comments 2019-08-10 17:36:53 +10:00
Paul Hauner
1beab66078
Remove unused method 2019-08-10 17:23:45 +10:00
Paul Hauner
989e2727d7
Changes to rest_api (#480)
* Add half-finished rest api changes

* Add basic, messy changes to rest api

* Fix expect() in ApiRequest

* Remove ApiRequest, add route for beacon state

* Tidy rest api, add get state from root

* Add api method for getting state roots by slot

* Add test for URL helper

* Simplify state_at_slot fn

* Add tests for rest api helper fns

* Add extra tests for parse root

* Fix clippy lints

* Fix compile error in rest api

* Update test to new ethereum-types
2019-08-10 17:15:15 +10:00
Paul Hauner
64a6e1475c
Various minor fixes 2019-08-10 11:31:31 +10:00
Paul Hauner
f4121d9deb
Ignore unknown blocks at fork choice 2019-08-09 12:34:56 +10:00
Paul Hauner
67fe21c1c0
Ensure committee cache is build during attn proc 2019-08-09 12:32:32 +10:00
Paul Hauner
d191812d4b
Fix overly restrictive check in fork choice. 2019-08-09 12:23:10 +10:00
Paul Hauner
76bb671084
Fix bug with fork choice, tidy 2019-08-09 11:54:35 +10:00
Paul Hauner
284166c7f8
Merge branch 'master' into attestation-processing 2019-08-08 17:11:19 +10:00
Paul Hauner
b1591c3c12
Remove attestation processing from op pool 2019-08-08 16:49:27 +10:00
Paul Hauner
7c134a7504
Simplify, fix bugs, add tests for chain iters 2019-08-08 16:47:24 +10:00
Paul Hauner
3a1f56a42e
Tidy ancestor iterators (#490)
* Tidy ancestor iterators

* Improve comments, remove code fragement
2019-08-08 12:28:10 +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
Paul Hauner
65ce94b2ef
Remove old code fragment 2019-08-07 16:54:35 +10:00
Paul Hauner
378fe05c89
Tidy attestation processing 2019-08-07 16:42:07 +10:00
Paul Hauner
fe2402b361
Add another attestation processing test 2019-08-07 16:02:30 +10:00
Paul Hauner
436c87abcd
Merge branch 'iter-fixes' into attestation-processing 2019-08-07 15:45:42 +10:00
Paul Hauner
2c3fc318ba
Do first pass on Grants code 2019-08-07 13:20:15 +10:00
Grant Wuerker
ce73705498
formatting 2019-08-06 19:17:15 +02:00
Grant Wuerker
c431bd993e
Implicit conflicts resolved. 2019-08-06 14:56:13 +02:00
Grant Wuerker
d11839c392
Merge branch 'master' into process-free-attestation 2019-08-06 12:28:30 +02:00
Grant Wuerker
f4b169ce80
Integration tests for free attestation processing 2019-08-06 10:03:24 +02:00
Grant Wuerker
dcac8d56bd
Revert "Refactored attestation creation in test utils"
This reverts commit 4d277fe4239a7194758b18fb5c00dfe0b8231306.
2019-08-06 10:03:22 +02:00
Grant Wuerker
78f3911522
Refactored attestation creation in test utils 2019-08-06 10:01:48 +02:00
Grant Wuerker
edd99fafb6
Getting attestation slot via helper method 2019-08-06 10:01:06 +02:00
Paul Hauner
b096e3a643
Tidy ancestor iterators 2019-08-06 14:29:45 +10:00
Paul Hauner
845f336a59
Interop chain start strategies (#479)
* Implement more flexible beacon chain genesis

* Fix compile issues from rebase on master

* Rename CLI flag

* Adds initial documentation for TOML files

* Update docs readme

* Add first version of cli_util

* Dont write cache fields in serde

* Tidy cli_util

* Add code to load genesis YAML file

* Move serde_utils out of tests in `types`

* Update logging text

* Fix serde YAML for Fork

* Make yaml hex decoding more strict

* Update deterministic key generate for interop

* Set deposit count on testing genesis state

* Make some fixes for deposit count

* Remove code fragements

* Large restructure of docs

* Tidy docs

* Fix readme link

* Add interop docs

* Tidy README
2019-08-06 13:29:27 +10:00
Paul Hauner
e21d3fed05
Revert "Tidy ancestor iterators"
This reverts commit 5079c25bb2.

Accidental push to master.. my bad!
2019-08-05 16:27:55 +10:00
Paul Hauner
5079c25bb2
Tidy ancestor iterators 2019-08-05 16:25:21 +10:00
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
Paul Hauner
7458022fcf
Fork choice bug fixes (#449)
* 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

* 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 12:08:52 +10:00
Pawan Dhananjay
db094022b9 Remove unused dependencies (#456) 2019-07-29 09:55:57 +10:00
John Adler
fec7168512
Fix lots of typos. 2019-07-26 15:26:06 -04:00