Commit Graph

261 Commits

Author SHA1 Message Date
Raul Jordan
cfd3e548cd Use Map for Inclusion Distance in EpochProcessing (#2346) 2019-04-22 17:08:20 -07:00
terence tsao
cda3f178cb
Optimize Attestation Inclusion Calculations (#2344) 2019-04-22 15:52:56 -07:00
Raul Jordan
629626dbe6
Loop Once Over state.LatestAttestations in Epoch Processing (#2342)
* single loop for extracting attestations

* complete
2019-04-22 17:31:01 -05:00
Raul Jordan
51d4965388 Enable Committee Cache By Default (#2323) 2019-04-22 06:37:42 -07:00
Raul Jordan
e9a8fc6d5e
Do Not Update Validator Registry on Nil Block (#2326)
* no registry update if block is nil

* regression test

* lint
2019-04-21 16:52:50 -05:00
terence tsao
1602c5d0c5
Use Withfields for Logging (#2305)
* use with fields

* gaz
2019-04-19 21:09:01 -07:00
terence tsao
2325b979ab
s/powchain/validator (#2292) 2019-04-18 10:57:21 -07:00
shayzluf
0732012459 Validator-multiple key (#2069)
* first version - broken

* working proto changes

* resolve review remarks

* fix goimport issues

* fix service issues

* first logic version-broken

* first running version - no new tests

* fix validator client test

* add wait group to goroutines

* remove unused var in function call

* fix review remarks and tests

* merge master changes and fix conflicts

* gazzele fix

* fix prestonvanloon requested changes

* merge and some of terenc3t remarks addressed

* _,pk bug fix in log

* fix account file name suffix and filter not active validator out

* merge with master and fix missing parameters

* run over all public keys in hasvalidators

* add test for error when no all the validators has index in the db and hasvalidators is called

* fix runner tests fail due to timing issues

* goimports

* smaller sleep time in proposer tests

* fix UpdateAssignments loging

* fix goimports

* added && false commented TestUpdateAssignments_DoesNothingWhenNotEpochStartAndAlreadyExistingAssignments

* hasvalidators without missing publickeys list

* fix some of prestone review remarks

* fixes for prestone comments

* review changes applied

* expect context call in TestWaitForActivation_ValidatorOriginallyExists

* changed hasvalidators to return true if one validator exists

* fix init problem to getkeys

* hasvalidators requiers all validators to be in db

* validator attest assignments update

* fix ap var name

* Change name to hasallvalidators

* fix tests

* update script, fix any vs all validator calls

* fix wait for activation

* filter validator

* reuse the reply block

* fix imports

* Remove dup

* better lookup of active validators

* better filter active vlaidators, still need to fix committee assignment tests

* lint

* use activated keys

* fix for postchainstart

* fix logging

* move state transitions

* hasanyvalidator and hasallvalidators

* fix tests with updatechainhead missing

* add tests

* fix TestCommitteeAssignment_OK

* fix test

* fix validator tests

* fix TestCommitteeAssignment_multipleKeys_OK and TestWaitForActivation_ValidatorOriginallyExists

* fix goimports

* removed unused param from assignment

* change string(pk) to hex.EncodeString(pk) fix change requests

* add inactive validator status to assignments

* fix logging mess due to multi validator setup

* set no assignment to debug level

* log assignments every epoch

* logging fixes

* fixed runtime by using the right assignments

* correct activation request

* fix the validator panic

* correct assignment

* fix test fail and waitforactivation

* performance log issue fix

* fix goimports

* add log message with truncated pk for attest

* add truncated pk to attest and propose logs

* Add comment to script, change 9 to 8

* Update assignment log

* Add comment, report number of assignments

* Use WithError, add validator as field, merge block proposal log

* Update validator_propose.go

* fix

* use entry.String()

* fix fmt
2019-04-18 12:23:38 -05:00
terence tsao
e51c2e5540 Use VerifyAttestation to Filter Attestation (#2281)
* use verify attestation to filter and tests

* fmt

* preston's feedback

* warn -> error

* Use WithError

* use WithError and Warn

* lint
2019-04-17 18:10:55 -05:00
Nishant Das
4e7eb21594 Fix Validator Store (#2277)
* add fix and tests

* fix lint

* lint
2019-04-17 13:57:13 -05:00
terence tsao
e4e6940c17
Update Latest Attestations Use Committee Cache (#2265) 2019-04-16 20:08:55 -07:00
Ivan Martinez
62279489a3 Add deposit index to beacon state (#2232)
* Begin adding Deposit Index to beacon state

* Move deposit index increment to ProcessDeposit

* Fix initial deposits bug

* Fix bug in RPC

* More bug fixes

* Fix RPC bug, ensure deposits are processed in the right order

* Fix tests

* Fix merge

* Attempt to fix pruning deposits on regular sync

* Fix pending deposits on node restart

* Fix test

* Fix tests properly

* Gofmt

* Remove unneeded logs

* Fix build
2019-04-14 18:17:39 +10:00
terence tsao
ae3eb0f199 fixed comments (#2234) 2019-04-12 11:43:28 -05:00
terence tsao
5a1cfacc80 Use Committee Cache for Assignment (#2237)
* fixed comments

* fixed comments

* use committee cache for CommitteeAssignment

* added tests for using cache for assignment

* addressed preston's feedback

* addressed nishant's feedback
2019-04-12 10:31:01 -05:00
Nishant Das
cb0c08c285 Add Lock to Block Processing in Sync (#2239)
* add lock

* remove context

* add announcements lock

* fix test

* fix transition

* change ordering of return args
2019-04-12 10:11:15 -05:00
Preston Van Loon
fa5d627545
Remove too many spans in block/slot/epoch processing (#2236)
* remove too many spans

* gazelle
2019-04-12 00:55:07 -04:00
terence tsao
b6bd8ba63d Committee Cache for State Transition (#2228)
* starting to get feedback

* better name

* export the necessary variables

* finished implementation in AttestationParticipants

* refactor deopendency issue

* gaz and fixed cache test

* fixed all the tests and lint

* clean up part 1

* lint

* fixed test

* fixed visibility

* cache tests for AttestationParticipants
2019-04-11 14:34:23 -05:00
Raul Jordan
249ec8751b Revert "Implement Cache Committee for RPC Server (#2151)" (#2227) 2019-04-11 07:50:01 +10:00
terence tsao
c2deace3f4 Implement Cache Committee for RPC Server (#2151)
* add committees cache

* Hook committee cache to rpc service

* fixed TestCommitteeAssignment_OK

* comments for ValidatorAssignment

* added tests for committees cache

* more updates to committee_cache_test.go

* new tests in validator_Server_test for cached/uncached scenearios

* removed ????

* gaz

* fmt

* added feature flags

* fmt

* remove hello

* uncomment

* lint

* Update beacon-chain/rpc/validator_server.go

Co-Authored-By: terenc3t <terence@prysmaticlabs.com>

* preseton's feedback

* better err handling

* fixed tests
2019-04-10 03:36:49 -04:00
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
Nishant Das
f2b9269650 Add Withdrawal Credentials to Validator Record (#2216)
* add fix and unit test

* Update beacon-chain/core/validators/validator_test.go

Co-Authored-By: nisdas <nish1993@hotmail.com>
2019-04-09 14:03:31 -04:00
Nishant Das
775f4d64a5
Update Travis (#2215)
* update travis

* update binutils

* upgrade binutils version

* remove cache

* none of this works

* upgrade ubuntu version

* lint fixes
2019-04-09 09:57:09 +08:00
terence tsao
97b5ef0cc2
remove unused funcs and vars (#2214) 2019-04-08 16:29:02 +10:00
Raul Jordan
3704126533
Improve Beacon Node Logging (#2175)
* improve beacon node logging

* better info logging

* much nicer balance logging

* lint

* tests
2019-04-05 22:37:46 -05:00
Preston Van Loon
c925632cc9
Add a span to block-by-slot (#2184)
* Add a span to block-by-slot

* /goroutinez
2019-04-05 19:19:27 -05:00
Raul Jordan
60c254d818
Use DB to Fetch Justified Block (#2172)
* builds

* db tests in core

* spacing

* Gazelle

* fix lint

* iterative block root loop

* Update beacon-chain/core/blocks/block_operations_test.go

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

* imports
2019-04-05 14:48:49 -05:00
Nishant Das
687f797dd8 Post Chainstart Fix (#2158)
* fixed seed and correct epoch

* fix test and add comments
2019-04-04 20:13:49 -07:00
Raul Jordan
a057c07830 Reduce State Size (#2144)
* reduce state size

* lint

* fork data

* addressed broken build

* make values 5x slots per epoch

* 5 epochs worth of arrays

* add back slash balances

* rem items

* test

* imports
2019-04-03 02:04:51 +08:00
Raul Jordan
7489e52b99
Refactor Chain Service Block Processing API (#2124)
* new block processing api

* fix tests

* lint

* spacing

* Update beacon-chain/blockchain/block_processing.go

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

* fix tests, remove enable powchain
2019-03-31 20:44:16 -05:00
Preston Van Loon
6b3df2f776 Fix max churn bug (#2121) 2019-04-01 00:47:38 +08:00
Ivan Martinez
365a06e709 Fix multiple deposits to the same pubkey pre-chain-start (#2030) 2019-03-28 20:44:27 -07:00
terence tsao
4e5c08f2a8
Use a mutex/lock on the validator store (#2104) 2019-03-28 16:19:42 -07:00
terence tsao
c777ce6546
Fix active validator indices for shuffling (#2101) 2019-03-28 15:31:46 -07:00
terence tsao
761f3352a0 Fix current epoch committee count (#2099)
* fix current epoch committee count

* prev epoch
2019-03-27 22:10:10 -05:00
terence tsao
4b7d093ea5
Fix ActiveValidatorIndices use slot (#2092) 2019-03-27 08:52:34 -07:00
terence tsao
2f4cddeb28 Enhance Logging for Validator Registration (#2085)
* better logging for validator registration

* gaz

* Update beacon-chain/core/validators/validator.go

Co-Authored-By: terenc3t <terence@prysmaticlabs.com>
2019-03-26 23:22:23 -05:00
Raul Jordan
b2fb22f31f Add EnableCrosslinks Flag Check to CanProcessRegistry Function (#2088)
* registry check with crosslinks feature flag

* gazelle

* fix tests
2019-03-26 22:46:28 -05:00
Preston Van Loon
ac7d5a7780
Update state metrics on save state (#2083)
* Update state metrics on save state

* fix tests
2019-03-26 18:29:45 -05:00
Raul Jordan
a4ea0a1eac
Disable Crosslinks for Testnet (#2075)
* disable crosslinks for testnet

* feature config

* add missing flag

* flag in tests

* fix tests
2019-03-26 10:40:55 -05:00
Nishant Das
0809b96c32 Fixes Initial Sync (#2041)
* plug forkchoice to blockchain service's block processing

* fixed tests

* more fixes...

* clean ups

* fixed test

* Update beacon-chain/blockchain/block_processing.go

* merged with 2006 and started fixing tests

* remove prints

* fixed tests

* lint

* include ops service

* if there's a skip slot, slot--

* fixed typo

* started working on test

* no fork choice in propose

* bleh, need to fix state generator first

* state gen takes input slot

* feedback

* fixed tests

* preston's feedback

* fmt

* removed extra logging

* add more logs

* fixed validator attest

* builds

* fixed save block

* children fix

* removed verbose logs

* fix fork choice

* right logs

* Add Prometheus Counter for Reorg (#2051)

* fetch every slot (#2052)

* test Fixes

* lint

* only regenerate state if there was a reorg

* better logging

* fixed seed

* better logging

* process skip slots in assignment requests

* fix lint

* disable state root computation

* filter attestations in regular sync

* log important items

* better info logs

* added spans to stategen

* span in stategen

* set validator deadline

* randao stuff

* disable sig verify

* lint

* lint

* save only using historical states

* use new goroutine for handling sync messages

* change default buffer sizes

* better p2p

* rem some useless logs

* lint

* sync tests complete

* complete tests

* tests fixed

* lint

* fix flakey att service

* bug fixes

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

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

* reenable shuffle

* enable shuffle
2019-03-25 13:23:57 -05:00
Raul Jordan
053038446c
Allow 8 Validator Multinode Cluster to Run Indefinitely (#2050)
* plug forkchoice to blockchain service's block processing

* fixed tests

* more fixes...

* clean ups

* fixed test

* Update beacon-chain/blockchain/block_processing.go

* merged with 2006 and started fixing tests

* remove prints

* fixed tests

* lint

* include ops service

* if there's a skip slot, slot--

* fixed typo

* started working on test

* no fork choice in propose

* bleh, need to fix state generator first

* state gen takes input slot

* feedback

* fixed tests

* preston's feedback

* fmt

* removed extra logging

* add more logs

* fixed validator attest

* builds

* fixed save block

* children fix

* removed verbose logs

* fix fork choice

* right logs

* Add Prometheus Counter for Reorg (#2051)

* fetch every slot (#2052)

* test Fixes

* lint

* only regenerate state if there was a reorg

* better logging

* fixed seed

* better logging

* process skip slots in assignment requests

* fix lint

* disable state root computation

* filter attestations in regular sync

* log important items

* better info logs

* added spans to stategen

* span in stategen

* set validator deadline

* randao stuff

* disable sig verify

* lint

* lint

* save only using historical states

* use new goroutine for handling sync messages

* change default buffer sizes

* better p2p

* rem some useless logs

* lint

* sync tests complete

* complete tests

* tests fixed

* lint

* fix flakey att service

* PR feedback

* undo k8s changes

* Update beacon-chain/blockchain/block_processing.go

* Update beacon-chain/sync/regular_sync.go

* Add feature flag to enable compute state root

* add comment

* gazelle lint fix
2019-03-25 10:21:21 -05: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
a98912ea58
State Transition Configuration Options (#2023)
* logging config options

* tests pass

* better naming

* log proposer idx instead of sig

* log avg balance
2019-03-18 00:19:44 -06:00
gzuhlwang
bb1389e362 fix typo (#2005) 2019-03-17 12:35:58 -04:00
Nishant Das
00ca1d7991 Fix Errors with Attestation to Current Chainhead (#1990)
* fix errors

* fix bit check to little endian

* fix all tests
2019-03-14 12:29:44 -04:00
Nishant Das
a2e3ae95ae revert change (#1985) 2019-03-13 20:31:03 -04:00
Ivan Martinez
84b7c3654b Rename forkutils -> forkutil (#1976) 2019-03-12 16:39:13 -07:00
Raul Jordan
c1a9937760
Post ChainStart Validator Activation (#1934)
* implemented all the merkle func signatures

* branch indices complete

* check for index out of range in generating merkle proof

* completed full tests for sparse merkle trie impl

* lint

* formatting

* gazelle

* commentary

* ivan comments

* fmt

* get rid of the deposit trie

* recalculate trie when eth1 data changes

* default data response recalculates tree

* update merkle trie to use raw bytes

* use the new verify merkle root func

* builds

* if default data response historical deposits are empty, return the deposit root at the contract at the time

* work on trie

* trying again with more logging

* keep track of merkle trie indices, use correct big int ops

* use uint for merkle idx

* add todo

* update ticker correctly

* fix config and remove unnecessary logs

* readd plus one fix

* clarify some details

* weird imports spacing

* gazelle, lint

* fix tests using the new deposit trie

* builds but tests still fail

* rpc tests

* lint

* tests pass

* bazel lint

* rem commented block

* revert att slot fix

* preston comments

* comments

* fix build

* address last comment

* use counter

* imports
2019-03-12 00:05:55 -04:00
terence tsao
64913d66f4
Fix off by 1 for attestation justified epoch checking (#1963) 2019-03-10 21:07:05 -07:00