Commit Graph

2977 Commits

Author SHA1 Message Date
Luke Anderson
b9276da9db
Flesh spec. & update display bugs.
- Add correct string formatting when incorrect parameters provided.
 - Fill /beacon/block and /beacon/block_root endpoints
 - Add 500 error responses to endpoints as appropriate
2019-08-29 13:36:51 +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
Luke Anderson
5b5e458938
Flesh out the API spec for the /network endpoints. 2019-08-29 13:12:56 +10:00
Paul Hauner
7bfe02be1c
Refactor slot clock. 2019-08-29 12:46:18 +10:00
Luke Anderson
ca07d72453
Removed methods for 'chain_id', since this is no longer applicable to ETH2. 2019-08-29 12:42:45 +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
Luke Anderson
faef347d18
Fleshed out some API endpoints.
- Added the /beacon/validator/block endpoint for GET (untested)
 - Added the /beacon/fork endpoint for GET
 - Cleaned up a bunch of unused imports & variables
 - Removed '/network/block_discovery' endpoint
2019-08-28 23:33:34 +10:00
Luke Anderson
0bd5ce65f4
Renamed the YAML spec document inside the 'docs' folder. 2019-08-28 21:26:18 +10:00
Luke Anderson
77e2f576af
Further aligning the API & implementation.
- Completed implementation of /beacon/head
 - renamed 'latest_finalized_checkpoint' to 'current_finalized_checkpoint' for consistency
 - Reorganised list of endpoints in both spec & router so that they match
 - Fixed the content-type modifications for /metrics
 - Added a new 'RFC' tag to the spec, to tag things that we have not implemented and aren't sure if it's useful.
 - Moved 'deposit_contract' under /spec
2019-08-28 21:25:38 +10:00
Michael Sproul
23a308e595
BLS and SSZ static tests 2019-08-28 18:46:16 +10:00
Kyle Liu
74af13a372 Fix this link per @blacktemplar to link to the actual crate (#518) 2019-08-28 09:32:54 +10:00
Luke Anderson
16ec330a79
Started aligning API spec with implementation.
- Adding some missing fields to structs
 - Rearranged the endpoints in the rest_api router, and renamed, using an 'implementation_pending' function
 - Added 'content-type' headers, to distinguish difference with /node/metrics
 - Updated OpenAPI spec to v0.2.0
    - Split /node/fork into /node/chain_id and /beacon/fork
    - Moved /metrics to /node/metrics
    - Added example to /node/metrics, since it's text/plain
    - Moved /node/network to just /network
    - Added lots of stubs for endpoints which exist in the router
    - Reordered large parts of the OpenAPI spec
    - Moved /chain/beacon/... to just /beacon/...
2019-08-28 02:05:19 +10:00
Luke Anderson
328f11d564
Validator API (#504)
* Implemented more REST API endpoints.
 - Added many of the endpoints, which return 501 - Not Implemented
 - Created helper function to return a not implemented error
 - Created a parse_pubkey function to get a PublicKey from a hex string
 - Created a HTTP handler for the validator endpoints
 - Started implementing validator/duties endpoint.

* Fleshed out get validator duties.
 - Re-implemented the get validator duties function for the REST API
 - Added an 'as_hex_string' function to FakePublicKey, beacuse it was missing.

* Fixed small caching/state bug.

* Extended to array of API inputs.
 - Created  function for getting arrays from GET parameters.
 - Extended get validator duties function to support array of validator duties.

* Tidy API to be more consistent with recent decisions

* Addressing Paul's comments.
 - Cleaning up function to get list of proposers.
 - Removing unnecessary serde annotations
 - Clarifying error messages
 - Only accept pubkeys if they are '0x' prefixed.

* Fixed formatting with rustfmt.
2019-08-28 00:40:35 +10:00
Paul Hauner
6bb3a65189
Guard reduced tree from errors 2019-08-27 18:09:31 +10:00
Michael Sproul
aed2f6407d
Bump EF tests to v0.8.3 2019-08-27 17:00:21 +10:00
Michael Sproul
4d2cdc9492
Update to spec v0.8.3 2019-08-27 16:59:53 +10:00
Paul Hauner
ce43a59fff
Update env.md (#506)
Resolves #505
2019-08-27 12:19:17 +10:00
Kyle Liu
82666e932e Removing old SSZ readme and replacing it with cargo badge. (#514)
* Removing old ssz readme per paulhauner, replacing with cargo badge.

Co-Authored-by: Paul Hauner <paul@paulhauner.com>

* Replacing my shitty text badge with an actual badge per Paul.

Co-Authored-by: Paul Hauner <paul@paulhauner.com>
2019-08-27 12:02:36 +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
7f6b700b98
Remove old git merge relic 2019-08-27 00:05:25 +10:00
Paul Hauner
6875ae8af5
Pull Eth2Config during bootstrap 2019-08-27 00:04:15 +10:00
Paul Hauner
81c898586e
Merge branch 'eth2-network-spec' into interop 2019-08-26 17:44:05 +10:00
Paul Hauner
901393b664
Clean datadir after config files have been loaded 2019-08-26 16:02:05 +10:00
Paul Hauner
39be2ed1d2
Improve CLI error messages 2019-08-26 15:57:40 +10:00
Paul Hauner
bab1f2b064
Rename CLI flag 2019-08-26 15:51:11 +10:00
Paul Hauner
b58aa1d148
Add custom config options to testnet sub-cmd 2019-08-26 15:47:03 +10:00
Paul Hauner
cf435d9653
Refactor beacon chain start code 2019-08-26 14:45:49 +10:00
Michael Sproul
5a7903a377
Improve BeaconState safe accessors
And fix a bug in the compact committees accessor.
2019-08-26 11:39:48 +10:00
Paul Hauner
140c677a38
Add much more progress to new CLI setup 2019-08-25 12:14:04 +10:00
Age Manning
1bea1755c4
Remove redundant code 2019-08-25 10:13:17 +10:00
Paul Hauner
7fd7aa2cdb
Tidy ConfigBuilder 2019-08-25 10:09:51 +10:00
Age Manning
9cdcc7d198
Update to latest libp2p 2019-08-25 10:02:54 +10:00
Paul Hauner
66d7838707
Remove GenesisConfig, add BeaconChainStartMethod 2019-08-25 09:43:03 +10:00
Age Manning
72cf50d904
Update to latest master 2019-08-25 09:06:26 +10:00
Age Manning
7ee080db60
Updated syncing algorithm 2019-08-25 08:25:54 +10:00
Age Manning
0d56df474a
Main batch sync debugging 2019-08-25 00:27:47 +10:00
Age Manning
b078385362
Improved syncing compilation issues 2019-08-24 01:09:29 +10:00
Paul Hauner
cdf3ade63f
Add further CLI progress 2019-08-23 18:23:58 +10:00
Paul Hauner
453c8e2255
Re-arrange CLI to suit new "testnet" pattern 2019-08-23 16:39:32 +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
a358bbc1b1
Update bootstrapper for API changes 2019-08-23 12:45:31 +10:00
Paul Hauner
7d11d78299
Abandon starting the node if libp2p doesn't start 2019-08-23 12:43:34 +10:00
Paul Hauner
94d987cb6a
Add /network/listen_port API endpoint 2019-08-23 12:13:03 +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