Commit Graph

834 Commits

Author SHA1 Message Date
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
John Adler
fec7168512
Fix lots of typos. 2019-07-26 15:26:06 -04:00
Grant Wuerker
51645aa9af
Correct process_attestation error handling. 2019-07-24 18:03:48 +02:00
Grant Wuerker
b2471eca49
Checking if the an attestation contains a latest message 2019-07-23 20:50:18 +02:00
Grant Wuerker
bef7ca6bfb
Cleaned up get_attestation_state 2019-07-20 12:49:41 +02:00
Grant Wuerker
7cdfa3cc27
Looser check on beacon state validity. 2019-07-19 14:52:01 +02:00
Grant Wuerker
b90edaf7f6
Merge branch 'master' into process-free-attestation 2019-07-18 12:33:22 +02: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
Grant Wuerker
40b166edcd
Retrieving state from store and checking signature 2019-07-11 16:32:01 +02:00
Grant Wuerker
adf1d9c533
Processing attestation in fork choice 2019-07-09 12:36:59 +02:00
Grant Wuerker
e23726c0a1
Renamed fork_choice::process_attestation_from_block 2019-07-09 12:36:26 +02:00
Michael Sproul
73c4171b52
op_pool: finish persistence support 2019-07-01 10:55:55 +10:00
Michael Sproul
7fe458af45
op_pool: re-jig deposit handling (needs more work) 2019-07-01 10:55:55 +10:00
Michael Sproul
604fe2d97f
op_pool: partial persistence support 2019-07-01 10:55:55 +10:00
Paul Hauner
8afe8b3569
Implement fixes from PR review 2019-06-24 15:31:36 +10:00
Paul Hauner
77fba0b98e
Fix bugs in fork choice, add more tests 2019-06-24 09:34:56 +10:00
Paul Hauner
f8fb011d6c
Finish fork test for beacon chain 2019-06-24 09:34:55 +10:00
Paul Hauner
8ed03e391d
Allow harness to produce fork blocks 2019-06-24 09:34:55 +10:00
Paul Hauner
e904e0a5a8
Fix bug in operations for block production 2019-06-24 09:34:55 +10:00
Paul Hauner
fbb40485c1
Add additional chain tests 2019-06-24 09:34:55 +10:00
Paul Hauner
299b4cb207
Document beacon chain harness 2019-06-24 09:34:55 +10:00
Paul Hauner
723283bd01
Add attestation strategy to chain harness 2019-06-24 09:34:55 +10:00
Paul Hauner
46c0e17682
Add arbitrary attestation for beacon chain harness 2019-06-24 09:34:55 +10:00
Paul Hauner
7a4c3e26ac
Fix bug in reduced tree fork choice 2019-06-24 09:34:54 +10:00
Paul Hauner
0b2ad4d0a1
Mark reduced_tree fork choice as incomplete 2019-06-24 09:34:54 +10:00
Paul Hauner
d0037f49d8
Add progress on debugging fork choice 2019-06-24 09:34:54 +10:00
Paul Hauner
85b23f9f1b
Add incomplete progress on fork choice 2019-06-24 09:34:54 +10:00
Paul Hauner
41a36da765
Update BeaconChain tests 2019-06-24 09:34:54 +10:00
Paul Hauner
55818e285a
Refactor block prod. to produce for forks 2019-06-24 09:34:53 +10:00
Paul Hauner
55196dff64
Remove iter mod from beacon chain
Now the iter mod in store is the only implementation
2019-06-24 09:34:53 +10:00
Paul Hauner
c6e24572c7
Improve chain harness tests 2019-06-24 09:34:53 +10:00
Paul Hauner
9c2bbb6c05
Add stubbed-out block processing to fork choice 2019-06-24 09:34:52 +10:00
Paul Hauner
f6c86d0f7f
Add attestations to beacon chain harness 2019-06-24 09:34:52 +10:00
Paul Hauner
1638a7aa62
Alias zero hash to genesis in find head 2019-06-24 09:34:52 +10:00
Paul Hauner
8fb6ffffe2
Add new beacon chain test harness 2019-06-24 09:34:52 +10:00
Paul Hauner
1128de535d
Ignore attestations to zero hash 2019-06-24 09:34:52 +10:00
Paul Hauner
f4621a9f1a
Improve reduced tree fork choice 2019-06-24 09:34:52 +10:00
Paul Hauner
7756a658a7
Update fork choice find head fn 2019-06-24 09:34:51 +10:00
Paul Hauner
2ee71aa808
Add new fork choice struct to beacon chain 2019-06-24 09:34:51 +10:00
Paul Hauner
4c0724fba6
Refactor block processing results, some sync logic 2019-06-12 23:54:16 -04:00
Paul Hauner
e550c0218f
Add various fixes to clippy lints
Thou shalt appease clippy
2019-06-10 11:01:25 -04:00
Paul Hauner
749f2fcb5f
Unify EthSpecs in Mainnet and Minimal 2019-06-08 08:49:04 -04:00
Paul Hauner
e74d49fc8a
Remove dupe info between ChainSpec and EthSpec 2019-06-08 07:57:25 -04:00
Paul Hauner
4cecf05198
Fix beacon chain block iters 2019-06-07 02:48:26 -04:00
Paul Hauner
591c8ae219
Reject re-processing the genesis block 2019-06-07 02:48:08 -04:00
Paul Hauner
f52d66a136
Fix bug in rev block iter 2019-06-06 00:31:18 -04:00
Paul Hauner
ed9f655877
Update BeaconChain iters 2019-06-06 00:28:36 -04:00
Paul Hauner
df366f99dc
Add block iter to beacon chain 2019-06-05 13:33:32 +10:00
Paul Hauner
8ab1d28c9f
Fix attestation processing metrics 2019-06-04 17:10:25 +10:00
Paul Hauner
f530f5a848
Ensure committees are built for block processing 2019-06-04 13:13:38 +10:00
Paul Hauner
82202a7765
Update components to suit v0.6.1 API 2019-06-04 09:37:40 +10:00
Paul Hauner
39cb63e01e
Merge branch 'v0.6.1' into docker-env 2019-06-04 09:25:00 +10:00
Michael Sproul
6bde64bd6a
spec v0.6: update beacon_node, validator_client 2019-06-03 16:13:51 +10:00
Paul Hauner
e310bdd904
Merge branch 'master' into v0.6.1 2019-06-02 13:49:24 +10:00
Paul Hauner
997095fc43
Add attestations per block metric 2019-06-01 15:29:13 +10:00
Paul Hauner
244ffbc604
Store genesis root in beacon chain, fix fork bug 2019-06-01 15:02:19 +10:00
Paul Hauner
c8ba44b0b5
Create db-level alias for genesis block 2019-06-01 12:56:35 +10:00
Paul Hauner
8831db1e0f
Fix recently introduced errors for gRPC block prod 2019-06-01 12:36:10 +10:00
Paul Hauner
08bf5817c9
Update fork choice to take just. head 2019-05-31 17:51:32 +10:00
Paul Hauner
2f9f8bf772
Tidy BeaconChain; del spec, unify head updates 2019-05-31 17:32:20 +10:00
Paul Hauner
8acffcc0db
Make some BeaconChain functions private 2019-05-30 18:38:41 +10:00
Paul Hauner
4851d8be03
Fix some metrics labels 2019-05-29 18:09:51 +10:00
Paul Hauner
42b6e0c8a9
Run fork-choice after every block import 2019-05-29 17:55:38 +10:00
Paul Hauner
9f1039a350
Add metrics to BeaconChain, tidy fork choice 2019-05-29 17:52:43 +10:00
Paul Hauner
64fbc6bf3c
Add additional metrics to BeaconChain 2019-05-29 15:45:09 +10:00
Paul Hauner
345f7d5f18
Add global metrics registry, pass to BeaconState 2019-05-28 17:30:09 +10:00
Paul Hauner
b28fa3d20b
Save the BeaconChain to store on state update 2019-05-27 17:58:15 +10:00
Paul Hauner
faa682a9b5
Implement saving BeaconChain on client drop 2019-05-27 17:58:15 +10:00
Paul Hauner
9ed8a4d380
Implement basic BeaconChain persistence. 2019-05-27 17:58:15 +10:00
Paul Hauner
76602a65fc
Add new fns to ForkChoice and SlotClock 2019-05-27 17:58:15 +10:00
Paul Hauner
ee8d13573f
Create BeaconChainTypes, thread through runtime 2019-05-26 15:59:29 +10:00
Paul Hauner
3bcf5ba706
Rename db crate to store 2019-05-21 18:20:23 +10:00
Paul Hauner
058829b64d
Update beacon_chain to latest DB 2019-05-21 17:27:06 +10:00
Paul Hauner
f1584dada4
Update BeaconChain struct to use new store 2019-05-21 13:36:14 +10:00
Paul Hauner
658b425cce
Merge branch 'master' into disk-db 2019-05-20 16:56:04 +10:00
Paul Hauner
6660311b2b
Rename EpochCache to CommitteeCache 2019-05-20 14:36:54 +10:00
Paul Hauner
fcabef91da
Use E for EthSpec trait, instead of B 2019-05-13 14:44:43 +10:00
Paul Hauner
ce8ebeccbc
Rename BeaconStateTypes to EthSpec 2019-05-10 14:47:09 +10:00
Paul Hauner
2a938f2fd5
Fix clippy lints 2019-05-09 13:35:00 +10:00
Paul Hauner
51dc97ee42
Allow fork_choice and beacon_chain to compile 2019-05-08 18:18:17 +10:00
Paul Hauner
05df7702d3
Merge branch 'master' into disk-db 2019-04-30 16:02:23 +10:00
Michael Sproul
32547373e5
spec: simplify cache_state
The `latest_block_root` input argument was unnecessary as we were always setting it to something
almost equivalent to `state.latest_block_root` anyway, and more importantly, it was messing up the
caching of the state root. Previously it was possible for the function to update the state's latest
block root, and then hash the outdated block root that was passed in as an argument.
2019-04-17 12:00:23 +10:00
Paul Hauner
b8c4c3308a
Update types to new tree_hash crate 2019-04-16 14:14:38 +10:00
Paul Hauner
1913be0c6f
Fix clippy lints 2019-04-03 16:23:09 +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
f03259991d
Merge remote-tracking branch 'origin/paul-gossip-test' into validator-enhancements 2019-03-31 15:37:23 +11:00
Age Manning
c85da612f6
Remove debugging statements 2019-03-31 15:35:54 +11:00
Paul Hauner
c6fc4f0769
Fix bug in attestation production 2019-03-31 15:35:27 +11:00
Age Manning
b4c21ccca3
Merge remote-tracking branch 'origin/paul-gossip-test' into validator-enhancements 2019-03-31 13:58:38 +11:00
Paul Hauner
b26f1f8e1c
Add build_all_caches method to BeaconState
Also adds a few more cache builds in BeaconChain.
2019-03-31 13:42:49 +11:00
Age Manning
ae8e470d21
Add patch for attestation crosslinks 2019-03-31 13:06:01 +11:00
Paul Hauner
4e71ed6972
Fix produce_attestation bug.
It was referencing the wrong crosslink.
2019-03-31 12:54:42 +11:00
Age Manning
e0680f9771
Correct compile error 2019-03-31 11:04:50 +11:00
Age Manning
77fb738c78
Merge latest gossip branch 2019-03-31 11:02:57 +11:00
Age Manning
fc5142c09a
Registers the attester service to the beacon node RPC client 2019-03-30 19:32:32 +11:00
Paul Hauner
65ae8fda47
Remove old attestation aggregator 2019-03-30 19:15:15 +11:00
Paul Hauner
935c64deef
Adds attestation validation to SimpleSync 2019-03-30 19:11:52 +11:00
Age Manning
a952acb86f
Add committee_len to attestation data 2019-03-30 17:20:33 +11:00
Paul Hauner
dbcc88ad67
Ensure BitVec is initialized using a multiple of 8
I found it was panic-ing when supplied a non-power-of-zero len.
2019-03-30 17:13:23 +11:00
Paul Hauner
7b3f317abf
Fix bug with attestation production
It was being produced with the wrong source root. I will raise an issue
on the spec as it's a tricky one.
2019-03-30 17:12:43 +11:00
Age Manning
bc305cacc2
Merge branch 'blop-pool' into validator-enhancements 2019-03-30 16:16:30 +11:00
Paul Hauner
397e104f9b
Implement Attestation building in test harness 2019-03-30 16:02:09 +11:00
Age Manning
6e254551af
Implement produce beacon block on gRPC beacon node server 2019-03-30 15:58:31 +11:00
Paul Hauner
cd9494181c
Push RwLock down into OperationPool
There used to be one massive lock on `BeaconChain.op_pool`, however that
would cause unnecessary blocking.
2019-03-30 12:26:25 +11:00
Paul Hauner
1840248af8
Remove old queues from BeaconChain 2019-03-30 12:00:31 +11:00
Paul Hauner
8bf7a83f37
Rename op processing methods on BeaconChain 2019-03-29 19:09:01 +11:00
Paul Hauner
2b53851062
Pass errors back from block ops processing 2019-03-29 18:54:01 +11:00
Paul Hauner
8b1a91e9ee
Add process_attestation to BeaconChain 2019-03-29 18:40:50 +11:00
Paul Hauner
46a978a5a9
Implement op pool for all ops execpt attestations 2019-03-29 18:30:03 +11:00
Luke Anderson
ba71e8adca
Merged age-validator-client into luke's changes on validator_client, and fixed all the merge conflicts. 2019-03-28 20:55:07 +11:00
Luke Anderson
c9e8fe53bc
Merged Age's changes and ripped out heaps of now obsolete stuff in the validator client.
- Replaced most instances of PublicKey with KeyPair, since they need to be passed into each validator thread now.
 - Pulled out a bunch of FreeAttestations, and replaced with regular Attestations (as per Paul's suggestion)
 - Started generalising pubkeys to 'signers' (though they are still just Keypairs)
 - Added validator_index into a few structs where relevant
 - Removed the SlotClock and DutiesReader from the BlockProducer and Attester services, since this logic is now abstracted to the higher level process.
 - Added a Hash trait to the Keypair (rather than just pubkey) which assumes the Pubkey uniquely defines it.
2019-03-28 15:50:57 +11:00
Age Manning
6f0c0e47c3
Update Validator RPC and cache building 2019-03-28 14:32:02 +11:00
Luke Anderson
c9a7977d69
Renamed some functions, trying to get beaconnode attestation stuff to work. 2019-03-27 14:30:09 +11:00
Paul Hauner
b006586d19
Add slot timer to beacon node 2019-03-27 10:36:20 +11:00
Paul Hauner
c82bad7602
Add cache builds when advancing chain slot 2019-03-27 10:34:52 +11:00
Paul Hauner
c27fdbe37f
Try to load keys from file when starting client 2019-03-27 10:28:27 +11:00
Paul Hauner
00b546e6b8
Update slot clock to use genesis slot 2019-03-26 15:44:28 +11:00
Age Manning
214fb5b8ff
Merge RPC branch 2019-03-25 21:31:49 +11:00
Luke Anderson
4cdeb6abe5
Progress towards validator signing attestations.
- Added a 'beacon_attester' RPC endpoint, so the BeaconNode can supply attestation data.
 - Renamed 'attestation_data' to just 'attestation' throughout (except where it is actually just the data structure).
2019-03-25 18:32:27 +11:00
Paul Hauner
708d9b5674
Add basic Gossip sync handlers 2019-03-25 14:27:20 +11:00
Paul Hauner
3dc5595a6f
Fix last errors stopping full chain sync 2019-03-24 16:35:07 +11:00
Paul Hauner
5f4f67f46f
Swap ImportQueue from a Map to a Vec
There's an edge case where different blocks can have the same block
body.
2019-03-24 14:22:12 +11:00
Paul Hauner
3eae7b3fc5
Add skip slot support to BeaconChain fns 2019-03-24 12:49:59 +11:00
Paul Hauner
a57a7c2394
Implement block imports for sync 2019-03-23 18:48:09 +11:00
Paul Hauner
4b5b5851a6
Allow sync to to request block bodies. 2019-03-23 13:23:44 +11:00
Paul Hauner
96ba1c8f77
Implement get_block_roots for syncing 2019-03-22 14:20:49 +11:00
Paul Hauner
7a75ee3d19
Merge branch 'master' into paul-sync 2019-03-22 07:11:04 +11:00
Paul Hauner
430702b38d
Clean println's out of state processing 2019-03-21 18:21:26 +11:00
Paul Hauner
ca18d4390a
Add first changes to syncing logic
- Adds testing framework
- Breaks out new `NetworkContext` object
2019-03-21 17:17:01 +11:00
Age Manning
4310f35b73
Merge branch 'master' into network-server 2019-03-20 14:31:35 +11:00
Paul Hauner
84f373fcc2
Fix clippy lints 2019-03-20 10:51:53 +11:00
Age Manning
41abdb7599
Remove sync crate, move into network crate 2019-03-19 00:05:06 +11:00
Age Manning
66f09e1b8e
Updates network branch to v0.5.0 2019-03-18 18:17:37 +11:00
Paul Hauner
71d95ee9db
Add new field to test_harness YAML, remove prints 2019-03-18 18:08:53 +11:00
Age Manning
2d52d2954d
Modify testnet spec to have few validators 2019-03-18 17:45:40 +11:00
Age Manning
6b5debe654
Organize beacon_chain typing
- Implements ClientTypes
- New network BeaconChain type for the networking service
2019-03-18 17:38:23 +11:00
Paul Hauner
edeace9e75
Fix issues with building on genesis block 2019-03-18 16:53:59 +11:00
Age Manning
bbad4bfa19
Starts initialisation of beacon chain in the client 2019-03-18 16:16:54 +11:00
Paul Hauner
6df5eee7f4
Update beacon_chain crate with v0.5.0 updates 2019-03-17 18:10:20 +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
Age Manning
c5a7c62d5d
Updates to latest master. 2019-03-08 11:15:38 +11:00
Paul Hauner
60098a051d
Fix/silence clippy lints 2019-03-08 09:23:57 +11:00
Paul Hauner
1ef2652cac
Add transfer processing to BeaconChain 2019-03-07 17:23:11 +11:00
Paul Hauner
5a21e19a31
Fix all compile errors from v0.4.0 update 2019-03-07 12:53:15 +11:00
Paul Hauner
a4e604a41e
Update BeaconChain to spec v0.4.0 2019-03-07 12:25:29 +11:00
Paul Hauner
93ce7b59e7
Merge branch 'master' into v0.4.0-types 2019-03-07 12:03:27 +11:00
Paul Hauner
663d39739f
Do project-wide s/epoch_length/slots_per_epoch/g 2019-03-04 17:51:54 +11:00
Age Manning
3b8f29a914
[Temp Commit] Implements more basic skeleton code. 2019-03-04 16:39:37 +11:00
Paul Hauner
f4d8b41a09
Add Exit inclusion queue to BeaconChain 2019-03-04 12:20:59 +11:00
Paul Hauner
f5e4fe29d7
Add comments to new BeaconChain methods
- Adds comments
- Also drops a message from `warn` down to `debug`. It was giving
warnings even on an Ok result.
2019-03-03 11:54:51 +11:00
Paul Hauner
fd819fb7ca
Set BeaconChain block propose failure log to warn
It think it's more suitable to a warn
2019-03-02 11:24:41 +11:00
Paul Hauner
1de723b275
Add proposer/attester slash queues to BeaconChain
Allows for storing and including AttesterSlashing and ProposerSlashing
objects in blocks.
2019-03-02 11:23:37 +11:00
Paul Hauner
c278c08e34
Remove unnecessary clone. 2019-03-01 16:57:24 +11:00
Paul Hauner
eeeff9ef02
Ensure chain-dumps come with earliest block first
Previously dump.first() was the latest block. IMO, this is
counter-intuitive
2019-03-01 16:56:52 +11:00
Paul Hauner
1097c8089b
Add naive deposit-handling to BeaconChain 2019-03-01 16:56:27 +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
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
Kirk Baird
9f9b466f95
Modify attestion_aggregation to use frok version in domain 2019-02-23 14:39:54 +11:00
Kirk Baird
a5cbda0b60 Merge branch 'master' into signature-scheme-update 2019-02-23 13:34:57 +11:00
Paul Hauner
a5de6a1915
Add caching to BeaconState.
Removes CachingBeaconState
2019-02-22 18:14:16 +13:00
Age Manning
846cbdd7f7
Generalise fork choice tests. 2019-02-19 14:37:17 +11:00
Age Manning
4eddb47fd0
Updates all fork-choices to use ChainSpec for consts. 2019-02-18 17:49:05 +11:00
Kirk Baird
2c8aa17e0d Merge branch 'master' into signature-scheme-update 2019-02-18 10:54:26 +11:00
Kirk Baird
9c4a1f1d1f
Update to signature-scheme 0.5.2 2019-02-18 10:50:40 +11:00
Paul Hauner
b0513b1ec1
Add and update logs 2019-02-16 15:08:33 +11:00
Paul Hauner
3b92b69028
Apply CachedBeaconState to some functions
- Attestation aggregation
- Getting attestation duties
2019-02-16 11:04:12 +11:00
Paul Hauner
7c920cfb96
Add incomplete progress on fixing test harness 2019-02-15 19:23:22 +11:00
Paul Hauner
ec4a658fe7
Add beacon state test builder, tidy errors 2019-02-15 16:12:24 +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
d2a1000520
Fix clippy lints in beacon_chain 2019-02-13 10:28:38 +11:00
Paul Hauner
61bbbab33d
Fix clippy lints in lmd_ghost 2019-02-13 09:27:09 +11:00
Paul Hauner
5fefc79521
Update BeaconChain for spec v0.2.0 2019-02-12 13:00:52 +11:00
Paul Hauner
85450ec254
Fix all compile errors from new Slot/Epoch types 2019-02-07 11:22:48 +11:00
Paul Hauner
9b1d8cd3c1
Update BeaconChain to use Slot newtype 2019-02-07 10:03:55 +11:00
Paul Hauner
d83bafae10
Fix compiler errors from BeaconChain refactor.
I accidentally forgot to include this in the last commit, my bad!
2019-02-05 05:26:47 +11:00
Paul Hauner
c1ed5cd2d8
Refactor beacon_chain.
Moves all the `BeaconChain` impls into the same file that the struct is
defined in.
2019-02-05 05:08:40 +11:00
Paul Hauner
5ca53190b5
Add comments to beacon chain fork choice 2019-02-01 18:18:39 +11:00
Paul Hauner
865919e398
Improve attester errors, move info -> helpers
- Ensured one can distingush between a committee error and an invalid
validator index when using `validator_attesation_slot_and_shard`.
- Renamed the `info.rs` file to `getters.rs`, for clarity.
2019-02-01 17:56:49 +11:00
Paul Hauner
a71e1031ce
Add docstrings to finalized_head 2019-02-01 17:07:59 +11:00
Paul Hauner
b99e4ed9f4
Tidy slot_dump, remove SlotDump, use CheckPoint 2019-02-01 17:04:25 +11:00
Paul Hauner
4d062d77f9
Move CheckPoint into file, tidy canonical_head 2019-02-01 16:58:12 +11:00
Paul Hauner
942ef4b002
Move advance_slot to its own file. 2019-02-01 16:30:42 +11:00
Paul Hauner
db230475d7
Remove SlotClock error from block production, tidy. 2019-02-01 16:21:18 +11:00
Paul Hauner
9d1f98ba8f
Delete SlotClock errs from block_processing, tidy. 2019-02-01 16:07:59 +11:00
Paul Hauner
1e6f85a5eb
Tidy BlockGraph, use parking_lot, add doc comments 2019-02-01 15:59:12 +11:00
Paul Hauner
d50a8b03f8
Set BeaconChain present_slot to read from state.
It used to read from the slot_clock, that has been replaced with
`read_slot_clock`.
2019-02-01 15:37:43 +11:00
Paul Hauner
92753fa24e
Tidy attestation_production and create docstrings 2019-02-01 15:26:36 +11:00
Paul Hauner
2ed5f69448
Tidy attestation_processing, add docstrings. 2019-02-01 15:19:50 +11:00
Paul Hauner
a86f7fa51b
Tidy AttestationAggregator, add docstrings. 2019-02-01 15:16:24 +11:00
Paul Hauner
20e45b3369
Refactor block_processing
- Add the rayon library for parallelization
- Move from std::sync::Rwlock to rayon::RwLock
- Add `state` field to BeaconChain
- Fix major bug in attestation validator where justified slot was
incorrectly looked up.
2019-02-01 14:48:09 +11:00
Paul Hauner
c1b3d1b63e
Tidy up and add some logs 2019-01-31 18:32:01 +11:00
Paul Hauner
d6adfc7655
Refactor justified_slot fn
Now it reads from the head state
2019-01-31 18:30:43 +11:00
Paul Hauner
3f13c25c05
Fix issues with per_epoch block_root calls
They were being called with the wrong slot.
2019-01-31 18:28:54 +11:00
Paul Hauner
c5a0170a0a
Tidy out some verbose debugs 2019-01-31 16:40:44 +11:00
Paul Hauner
8073296f5d
Ensure per_epoch processing always runs.
Previously, it was running _after_ a state transition, not before it
with the slot processing.
2019-01-31 16:39:44 +11:00
Paul Hauner
ae39a24e71
Add committee_index to aggregator
Fixes a bug where the validator index bit was set on the bitfield,
instead of the committee index
2019-01-31 14:16:28 +11:00
Paul Hauner
2fc6dbb02a
Fix bug with inclusion_distance 2019-01-31 08:49:50 +11:00
Paul Hauner
7d94cfb0e4
Refine state transition to allow first transition 2019-01-31 00:39:34 +11:00
Paul Hauner
6a4252b8c6
Add state helpers from #148 2019-01-28 19:12:20 +11:00
Paul Hauner
2882110525
Add attesatation aggregation to test harness 2019-01-28 17:07:13 +11:00
Paul Hauner
be7e326c33
Add FreeAttesation type 2019-01-28 16:21:33 +11:00
Paul Hauner
5bbffcb053
Add attester to beacon chain test harness 2019-01-28 15:50:42 +11:00
Paul Hauner
e1698102e0
Add attestation aggregation to BeaconChain 2019-01-28 13:04:50 +11:00
Paul Hauner
e9abf06364
Add attestation production to BeaconChain 2019-01-28 13:00:45 +11:00
Paul Hauner
d1ac7c037d
Add chain.justified_head 2019-01-28 13:00:08 +11:00
Paul Hauner
b516fd472e
Rename chain.canonical_head to head 2019-01-28 12:58:20 +11:00
Paul Hauner
fd47f6c433
Move attestation validator to BeaconState fn 2019-01-27 17:54:26 +11:00
Paul Hauner
b487db68a1
Add signable_message() to Attestation 2019-01-27 17:28:16 +11:00
Paul Hauner
8e9a139560
Make BeaconChain CheckPoint fields public 2019-01-27 15:39:34 +11:00
Paul Hauner
22a08e5160
Fix failing tests 2019-01-26 22:22:52 +11:00
Paul Hauner
7ee836d118
Implement the majority of per-epoch processing 2019-01-26 22:07:50 +11:00
Paul Hauner
eb77fb75b7
Dump chain to JSON file 2019-01-26 08:25:56 +11:00
Paul Hauner
dbd5e850fe
Add chain_dump fn to beacon_chain 2019-01-26 07:20:58 +11:00
Paul Hauner
4d3889d838
Remove old hash_tree_root stub from state trans 2019-01-25 17:47:33 +11:00
Paul Hauner
f9acc42aca
Rename canonical_hash to `hash 2019-01-25 17:40:22 +11:00
Paul Hauner
ad62e1e35c
Rust cargo fmt 2019-01-25 17:23:54 +11:00
Paul Hauner
78c00d3361
Move back to using proposer_slots 2019-01-25 16:54:19 +11:00
Paul Hauner
138fcd6275
Fix issues with old state information 2019-01-25 16:47:24 +11:00
Paul Hauner
ea523c8658
Merge spec crate into types 2019-01-25 13:52:21 +11:00
Paul Hauner
9c86c07eea
Fix unused deps warnings 2019-01-25 13:05:11 +11:00
Paul Hauner
f4f5b3a13c
Update beacon_chain as per test bugs 2019-01-25 11:30:06 +11:00
Paul Hauner
6fd3a1a03e
Add progress on test rig 2019-01-25 08:18:47 +11:00
Paul Hauner
b29934aed4
Update state transition as per spec 2019-01-24 12:10:03 +11:00
Paul Hauner
1256ba0d01
Implement very raw state transition logic 2019-01-23 19:25:05 +11:00