Commit Graph

149 Commits

Author SHA1 Message Date
Nishant Das
98042c613d
Update State to Include Current and Previous Justified Roots (#2186)
* update protos

* Revert "Use DB to Fetch Justified Block (#2172)"

This reverts commit 60c254d818.

* use justified root and previous justified root across the repo

* change attester server to use state justified root

* remove commented code

* fix build issues

* fix test

* fix all tests

* fix merge issues
2019-04-10 14:52:06 +08:00
Preston Van Loon
d7488b9a1e
Support multiple pubkeys for committee assignments (#2164)
* support multiple pubkeys

* a bit of refactoring to avoid calling db.state multiple times

* Add test for supporting multiple keys

* rename proto field
2019-04-05 10:10:13 -05:00
terence tsao
a19f08f7b6 Attestation Using Head State instead of Latest State (#2156)
* headRoot is a better name

* yay merged with master

* fixed attester server returning incorrect attestation field values

* revert stupid mock changes

* fixed and updated all the tests

* uncomment

* head start should handle skip blocks

* Raul's feedback
2019-04-05 09:41:49 -05:00
Preston Van Loon
83130358a9
Rollback state to handle side chain with skip blocks (#2147)
* Add initial test

* chkpt

* add failing test

* add span to historical state lookup

* use db.HighestBlockSlot()

* fix comment

* update comment

* i wrote a test like a good programmer.

* add test back

* add assertion and unskip test, something new failing tho

* trying to fix test

* remove -1, not sure if i need it yet

* Revert "remove -1, not sure if i need it yet"

This reverts commit 2cfcbb8108b28bb3d7135a993d9053150d5f1e6e.

* save historical state on every save state

* fix hsitorical states

* set historical state in initialize state

* change to a bool

* fix error with empty retrieval of states

* Add missing import

* fix test

* lock in receive block

* remove state generator

* Revert "lock in receive block"

This reverts commit 151b10829d70b2dad3055a8db36d0e1269a853f2.

* Fix Initial Sync Not Processing Canonical Block to Produce Canonical State (#2152)

* fix init sync

* fatal if highest observed root does not match

* proto fields

* Update beacon-chain/sync/initial-sync/service.go

* confirm canonical state root

* fix most tests

* failing test

* fix PR tests

* lint

* no simbackend changes

* logf revert

* add todo

* fix off by one

* fix test with deleted property

* merge #2157

* passing tests :)
2019-04-04 22:39:51 -05:00
Raul Jordan
eb900a8193
Refactor Initial Sync, Enable Catching Up to Chain (#2111)
* refactor initial sync to prevent reorg infinite loops

* lint

* fixed build

* passing tests

* tests passing

* terence suggestion

* new attempt

* clean up and refactor sync service

* complete the new initial sync logic

* revert head

* init sync working

* config for blockchain receive block

* all works

* builds

* fix a few more tests

* init sync tests pass

* revert scripts

* revert accounts changes

* lint

* lint2

* travis lint

* fix build

* fix single use argument

* any peer

* imports spacing

* imports

* ready for a rolling restart

* add todo

* fork choice in blocks when exiting sync

* readd finalized state root to requests

* successful build

* revert blockchain config

* old config reversion

* initial sync tests pass

* initial sync full test works

* lint

* use the new block processing api

* new proto defs

* init sync functions again

* remove sync polling

* tests fixed

* fixed catching up with chain

* tests pass

* spacing

* lint

* goimports

* add changes

* add lock and conditional to prevent multiple goroutines

* make reg sync synchronous

* add

* fixed the parent block issue

* fix errors in chain service

* tests pass

* check nil block

* typo

* fix nil state

* merge & conflicts

* revert synchronus reg sync

* add more spans to state db

* fix lint

* lint
2019-04-03 10:13:19 -05:00
Raul Jordan
5b89da1ce2
Revert "Prevent Reorg Infinite Loops in Initial Sync (#2109)" (#2110)
This reverts commit d0790246a2.
2019-03-29 16:51:58 -05:00
Raul Jordan
d0790246a2
Prevent Reorg Infinite Loops in Initial Sync (#2109)
* refactor initial sync to prevent reorg infinite loops

* lint

* fixed build

* passing tests

* tests passing

* terence suggestion
2019-03-29 13:11:13 -05:00
Preston Van Loon
030f44bb04 Revert "Treat Post & Pre-ChainStart Validators Equally in Assignments Fetching (#2074)" (#2086)
This reverts commit fcc18fac02.
2019-03-26 22:30:22 -05:00
Raul Jordan
fcc18fac02
Treat Post & Pre-ChainStart Validators Equally in Assignments Fetching (#2074)
* treat post/prechainstart validators equally in assignment fetching

* Update validator/client/fake_validator_test.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* status err code

* imports

* beyond activation epoch

* assigned to slot log

* gazelle
2019-03-26 09:03:05 -05:00
Preston Van Loon
2b3cb50461 Fix bug where proposer didn't also attest (#2073)
* fix bug, thanks @djrtwo

* remove unnecessary variable

* fix lint

* danny cfg
2019-03-26 00:14:03 -05:00
shayzluf
6335833c94 Validator: performing for multiple keys - update rpc proto (#2040)
* first version - broken

* Scripts to update mockgen

* working proto changes

* resolve review remarks

* fix goimport issues
2019-03-23 19:46:25 -05:00
Preston Van Loon
03dfafcb43
Broadcast attestations (#2035)
* broadcast attestations

* register p2p topics

* handle p2p messages for attestation announcements

* p2p -> P2P

* gazelle

* Remove unused var
2019-03-19 23:54:16 -04:00
Nishant Das
f801bfedcf Fix State Generator (#2010) 2019-03-18 20:15:50 -06:00
Raul Jordan
7a83acf46d
Improve Validator Logging and Default Flags (#2013)
* improve validator logging significantly

* warn validator not yet assigned to epoch

* build added

* report validator logs

* validator performance logging

* all logging improvements

* validator attest better logs

* improved attester logging

* average balances

* dont hash useless hashes

* Update validator/client/validator_propose.go

Co-Authored-By: rauljordan <raul@prysmaticlabs.com>

* address some comments

* standardize with block root hash32, renamings

* gazelle

* builds

* improve average eth balance

* eth net gains/losses

* fix tests

* spacing

* goimports

* avg balance

* update pbs

* addressed preston comments

* imports

* gazelle
2019-03-18 09:45:28 -06:00
Raul Jordan
6c580e6bf2
Update All Our Documentation (#2012)
* full docs update

* update README

* gofmt and goimports
2019-03-17 16:30:46 -06:00
Preston Van Loon
612bb38077 Cross p2p spans, more spans, synchronous attestations, minor fixes (#2009)
* Fix assignments bug where validators don't retry for assignments on failure

* synch only please

* trying to fix state issues

* trying random stuff

* do not explode

* use ctx

* working build, failing tests

* broadcast local addrs as well as relay addrs

* fixed p2p tests, more tests to fix still

* another test fixed, log warning instead of throw error

* Fix last tests

* godoc

* add test for broadcast in apply fork choiec

* remove unneeded code

* remove tracer adapter, not needed

* remove extra stuff

* remove any

* revert addr_factory

* revert addr_factory

* Revert "revert addr_factory"

This reverts commit e93fb706494a1070158b8db31e67146d6b0648ad.

* Revert "revert addr_factory"

This reverts commit dedaa405559cc818698870c4e4570953367f1e3c.

* revert removal of this code

* unused param
2019-03-17 10:56:05 +08:00
Nishant Das
000a42deac Make State Requests only Request for Finalized State (#1955)
* remove hash field for state request

* change to finalized state root

* refactor code for bug

* add in saving of finalized state

* add method to db

* adding finalized state root

* add new changes

* add in new changes

* add in return vars

* goimports

* review comments

* error message

* fix broken build

* fix cache state tests

* lint
2019-03-12 16:44:21 -04:00
Raul Jordan
205594c5d6 Fix Travis Failures on Master (#1938)
* resolve travis conflicts

* cp proto

* revert

* remove unused context
2019-03-07 23:54:41 -05:00
Nishant Das
2f9de6f93c Clean Up Batched Request (#1932)
* goimports

* do not log empty batches

* invalid request
2019-03-07 16:43:48 -06:00
Preston Van Loon
1f550a0da9
Handle nil protos (#1927)
* Handle hash nil pointers

* handle in hash beacon block

* add recovery when broadcasting p2p messages

* cmt

* gazelle
2019-03-07 11:32:01 -05:00
Preston Van Loon
90225aac31 PendingAttestations: allow for request to specify a slot (#1922)
* PendingAttestations: allow for request to specify a slot

* enhance the test
2019-03-07 09:56:22 -06:00
Raul Jordan
c22e4dc2ae
Wait for Validator Activation Stream Server (#1896)
* create wait for activation stream

* wait for activation server stream open

* complete server side logic

* formatting

* first test passing

* context closed test

* lint

* fix build failure

* imports

* eliminate unused cancel var
2019-03-05 17:06:50 -06:00
terence tsao
b00891880e
Implement Validator Status RPC Methods (#1839) 2019-03-03 21:28:00 -08:00
terence tsao
17682321fe
Clean Up Validator RPC Server (#1798) 2019-03-03 14:55:12 -08:00
Raul Jordan
88765b6d3c
Fix Attestation Info at Slot to Match Justified Epoch Expectations (#1768)
* fix crosslinkt committees

* fix lint

* fix in epoch

* imports

* add gx tags

* epoch shuffling tests

* regress test

* preston comments

* service change

* advance to handle skip slots

* ready

* imports

* rem unnecessary log

* revert config

* last comment

* imports
2019-03-01 18:33:55 -06:00
terence tsao
4bc324dc95
Make Getting Epoch Assignment Generic (#1746) 2019-02-27 17:16:05 -08:00
terence tsao
9f950211d8
Rename Shard Block Root to Crosslink Data Root (#1743) 2019-02-27 15:07:39 -08:00
Ivan Martinez
136950e0c5 Update some of client to v0.3 spec (#1733)
* Update validator to v0.3 spec

* Fix typos with rename
2019-02-27 12:21:15 -08:00
Raul Jordan
e19920aec1
Miscellaneous Runtime Fixes & Improvements - Raul (#1674)
* fatal if impossible to receive chainstart

* fix tests

* fix

* custom delay

* completed custom delay

* errors

* better logs, nothing at genesis

* use demo in val

* add gazelle

* log

* starting to log stuff

* pass in ops

* avoid printing the large #s for debug, still working on tests..

* all around better logging

* fixed build error in epoch process

* fixed state transiton tests

* fixed block tests

* lint

* verify sigs in randao

* ready for inclusion falg

* only print waiting when slot is not valid

* fix build

* mod config

* fixed last justified slot issue

* fix inclusion

* fixed attestation issue

* using zero hash from params instead

* fix tests

* update balance

* removed swp

* more `- genesis_slot` for logs

* rem unused log

* fix broken tests

* account for skip slots in state root computation

* fixes done

* validator guide bug fixes - 671

* epoch boundary at the last slot of the epoch

* fix epoch issue

* more balance cal logs for debugging

* greater balance

* attestaton fixes

* fixes

* addressed testrun

* fixed ejection balance

* fix tests with far future epoch

* revert sync change

* revert initial sync change

* fix changes

* off by one att fix

* revert the att fix

* address comments

* format

* fix build

* rem file
2019-02-24 20:09:45 -06:00
terence tsao
06bfda24d5 Revert "Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655)" (#1664)
This reverts commit 15f8b6a10d.
2019-02-20 14:46:30 -06:00
terence tsao
15f8b6a10d
Remove Redundant Committee Assignment Getters in Validator RPC Service (#1655) 2019-02-20 11:53:49 -08:00
Raul Jordan
19abe81472
Implement Randao Reveal Signing in Proposer Client (#1650)
* finish the BLS API wrapper

* all tests passing

* unexported comment

* gofmt tests for bls

* block processing test into own package to avoid cycle

* randao tests pass

* blocks test passing

* use common deposit generator

* helper

* resolved import cycle

* setup initial

* builds

* almost done with blockchain tests

* fix blockchain tests

* getting through with chaintests

* revert client change

* lint

* sync master conflict gazelle

* randao test fixes

* randao proposer impl

* tests pass
2019-02-20 12:58:34 -06:00
terence tsao
c0bf3ec5b9
Implement Attestation Req/Res for Sync Service (#1654)
* sync responds for attestation and unseen attestations

* hook up routines

* wrapped up tests

* better name

* gaz
2019-02-19 22:29:51 -08:00
terence tsao
c30bef0812
Implement Next Epoch Committee Assignment for RPC Server (#1641) 2019-02-19 15:31:04 -08:00
Raul Jordan
2425bef5c7
Update Configuration, Naming, and GenesisStart to Accommodate Randao (#1647)
* signature on startup configuration

* remove ref to hash32s for randao

* completed changes
2019-02-19 14:24:00 -06:00
Raul Jordan
3e46381b3f
Fetch the Correct Chain Head During AttestHead (#1596)
* correct attester view of chain head and prioritize proposer

* fix attempt not working

* revise with correct logic

* attester fixess to root fetching, spec did not make sense

* comments to match code

* fix attester responsibility

* comments
2019-02-18 23:49:56 -06:00
Ivan Martinez
650372915f Hotfix/add both role case (#1627) 2019-02-18 14:51:49 -08:00
terence tsao
8c04ced1a6 Name Changes to Align with V0.3 (#1621)
* fixed epoch_processing

* penalize->slash

* exit -> voluntary_exit

*  SEED_LOOKAHEAD -> MIN_SEED_LOOKAHED

* ENTRY_EXIT_DELAY -> ACTIVATION_EXIT_DELAY

* `INCLUDER_REWARD_QUOTIENT` -> `ATTESTATION_INCLUSION_REWARD_QUOTIEN`

* LatestIndexRoots -> LatestActiveIndexRoots

* `MIN_VALIDATOR_WITHDRAWAL_EPOCHS` -> `MIN_VALIDATOR_WITHDRAWAL_DELAY`

* MAX_WITHDRAWALS_PER_EPOCH -> MAX_EXIT_DEQUEUES_PER_EPOCH

* ETH1_DATA_VOTING_PERIOD -> EPOCHS_PER_ETH1_VOTING_PERIOD

* SLOT_DURATION -> SECONDS_PER_SLOT

* EPOCH_LENGTH -> SLOTS_PER_EPOCH

* SLOT_DURATION -> SECONDS_PER_SLOT take 2

* rest of the misc fixes for config name changes

* remove tools/bootnode/.!74296!bootnode.go

* `current_epoch_start_shard` -> `current_shuffling_start_shard`, `current_shuffling_epoch`, `current_shuffling_see`

* go fmt

* fixed comment

* updated pseudocode comments

* merged master
2019-02-18 10:52:16 -06:00
Raul Jordan
c032b0f6b5
Pending Attestations RPC Server/Client Implementation (#1617)
* complete tests for integrating the attestations pool

* fix broken build
2019-02-15 18:36:40 -06:00
terence tsao
fa47a9bf36
Remove Justified Slot (#1561) 2019-02-13 16:42:33 +00:00
terence tsao
05b29d6226 Update PendingAttestationRecord Proto (#1567)
* fixed epoch_processing

* test p2p

* PendingAttestationRecord -> PendingAttestation
2019-02-12 12:04:30 -06:00
Raul Jordan
3d8bb73f15
Attester RPC Server Functions (#1505)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* server implementation logic

* attestation info tests

* completed passing tests, tree hash still blocked by error with nil fields unfortunately

* fix todo failure

* gazelle rerun and master merge

* testing full behavior of attestation info server

* finished all required server tests and implementation

* break loop

* fix tests due to genesis slot updates
2019-02-11 10:15:25 -06:00
terence tsao
e321fdfafa Update to Use Crosslink in AttestationData (#1546)
* fixed epoch_processing

* test p2p

* attestation uses crosslink instead of crosslink root hash

* lint
2019-02-10 11:59:17 -06:00
Raul Jordan
12524ae8dd
Update RANDAO to Match Spec (#1533)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* deprecate all instances of old randao logic

* fix all broken tests and cleanup randao references across repo

* builds but tests failing

* fixing broken chaintests

* only chaintests fail now

* randao fully updated

* add bls todo

* lint

* travis

* fix unresolved property in struct

* remove used randao var
2019-02-09 14:35:51 -06:00
Raul Jordan
7ae19ec370
Align Block Operations to Spec (#1512)
* fix bug in eth1 data vote count increases

* updating attester slashings

* is double vote and attester pseudocode

* attester slashing revamp complete

* exits processing complete

* all block operations aligned to spec

* completed test revamp

* builds properly

* all done FINALLY

* address comms

* comment

* no more confusing is double vote function

* surround
2019-02-08 15:53:36 -06:00
terence tsao
b099f5d216 Aligning ETH2.0 spec - Update Validator Fields (#1513)
* remove ValidatorRegistryDeltaBlock

* fixed tests after changing validator functions to epoch first

* gaz
2019-02-06 15:46:05 -06:00
Nishant Das
9ecef934d8 Update Beacon State to Match the Spec (#1489)
* first line of changes

* fix all tests in core package

* Finished fixing up all tests

* docs

* more docs
2019-02-06 10:44:27 -06:00
Raul Jordan
61026103c6
Validator Attester Rewrite (#1487)
* initial validator attesthead rewrite based on proposer rewrite

* proceed with fetching committees and tree hashing the canonical head at assigned attester slot

* complete filling the properties of attestation data and all associated root hashes

* add when to attest todo

* finish entire attester client logic

* tests with mocks checked in

* tests passing in client

* stubbed out server implementation

* fixed build due to old property

* regen mocks with new mockgen version

* fixed broken tests

* complete bazel build fix

* address some review comments

* deep proto test

* tests passing after checking for empty committee and crosslink root

* address nishant comments
2019-02-06 10:20:38 -06:00
terence tsao
2441266898
Aligning ETH2.0 spec - Crosslink Records (#1507)
* updated proto state fields to unlock alignment

* moved AttestationParticipants to rightful location

* crosslink committees to use epoch
2019-02-06 15:00:50 +01:00
terence tsao
a4b5666059 Aligning ETH2.0 spec - Update Fork and Domain Helpers (#1501)
* updated proto state fields to unlock alignment

* updated domain and fork helpers

* fixed comments

* fixed comments
2019-02-05 23:34:22 -06:00