Commit Graph

280 Commits

Author SHA1 Message Date
Nishant Das
25ce3a3676 Add Excess Deposit Flag to allow Validator Balances more than 32 ETH (#2625)
* add flags and code

* adding tests

* gaz

* Update shared/featureconfig/config.go

Co-Authored-By: Preston Van Loon <preston@prysmaticlabs.com>
2019-05-17 17:10:34 -04:00
terence tsao
cf8e474410 Avoid Panic Retrieving Validator Public Key (#2566)
* exclusive of finalized block

* fixed saveValidatorIdx to skip validator not in state

* fixed test

* tests

* comment

* comment

* fixed test

* comment
2019-05-11 17:08:00 -04:00
Nishant Das
678ffa607e Fix Bitfield in Attestations (#2565)
* fix bitfield

* test

* fix reference

* fix tests

* remove test

* fix test

* add new helper

* add test

* fix tests

* fix test

* gaz

* add continue
2019-05-11 16:49:09 -04:00
Preston Van Loon
8a4f322e2c Check context has not expired before expensive operations (#2541)
* use ctx.Err for potentially expensive RPC methods, use batch for saving attestations

* more

* in sync too

* Update BUILD.bazel

* fix spacing
2019-05-08 18:51:00 -05:00
terence tsao
eb626e5834
fixed atts verification (#2527) 2019-05-07 15:51:41 -07:00
Raul Jordan
d5c0a99578 Display Only Active Validator Data (#2490) 2019-05-05 09:40:21 -07:00
terence tsao
71b702a3ab Only Log Active Balances (#2485)
* only log active balance

* dont need ()
2019-05-04 11:31:26 +08:00
terence tsao
a015056332 Add metric for correctly attested rate (#2452)
* add metrics for corret participation rate

* gaz
2019-04-30 16:06:31 -05:00
terence tsao
d453b0f199 fixed typos (#2444) 2019-04-30 14:55:14 -05:00
terence tsao
7a7b4e55c9
prevent validator exit reentrance (#2443) 2019-04-29 16:25:31 -07:00
terence tsao
bff774de32 Operation service prunes invalid attestation (#2439)
* prune atts > one epoch old

* use VerifyAttestation instead

* added test to prune invalid att

* space

* added ctx

* fixed existing tests

* gaz

* gazelle
2019-04-29 15:03:28 -05:00
terence tsao
63998b92aa Add and Use Truncate Hash Library (#2417)
* add truncate lib

* use trunc

* spaces
2019-04-29 13:11:51 -05:00
Nishant Das
c288af5e9b Continue Processing Invalid Deposits (#2437)
* fix for pending deposits

* add regression tests
2019-04-29 09:54:55 -05:00
terence tsao
4a90f82bcc Fix Validator Ejection for Testnet (#2438)
* set ejection threshold and add gauge

* spaces

* gaz
2019-04-29 09:39:31 -05:00
frederickalcantara
a170c69653 upgrading linter from gometalinter to golangci-lint (#2100)
* upgrading linter from gometalinter to golangci-lint

* fixed golangci-lint linting

* removed linting before_script command

* removed disable-all command

* Fixed golang config file

* fixed golang config file v2

* removed gosec issue rule

* formatting

* fixed travis build to run golangci-lint

* Add install golangci-lint command

* fixing golangci-lint script

* removed https://

* Added golangci-lint cmd script

* added go get for local lint install

* created a before_script

* add install before script

* Added get script

* added go mod download

* removed go mod downloads

* changed

* removed before script

* Added before script go get lint

* added exit zero to see what went wrong

* removed golang run script

* removed before script

* change lint command

* verbose output

* removed verbose

* change linter enable and disable configuration

* Update .golangci.yml

Removed gotype as a linter

* Update .golangci.yml

Added typecheck linter

* Update .golangci.yml

Added fixed lint version

* Update .golangci.yml

Added gotype

* Update .golangci.yml

Added typecheck

* removed env:lint

* Added env lint

* fixing lint upgrade

* Changing travis configuration

* FIxed spelling errors

* disabled typecheck

* Enabled typecheck

* remove binary

* Deleting lib binary

* adding more linters

* fixed constants

* fix spelling

* fixed all lint issues

* Revert "Changing travis configuration"

This reverts commit 334afe9d05e96261b01f275aa3ada20e7f36aac4.

* Merge branch 'master' of https://github.com/prysmaticlabs/prysm into update-linter

* Changed from Infof to Info

* Fixing commits

* fixing commits with linter config

* added install

* Fixing

* fix log statement
2019-04-26 14:24:01 +08:00
Nishant Das
89600e8978
Remove Duplicated Functions in the Slice Package (#2389)
* remove duplicated funcs

* lint

* remove duplicated tests
2019-04-26 12:31:27 +08:00
Nishant Das
75be7be646
Handle Panics In Attestation and Disable Logging (#2380)
* Revert "Use State Instead of Cached Registry (#2372)"

This reverts commit 941810ee7b.

* handle panic

* fix logging

* add test

* gazelle
2019-04-25 21:11:07 +08:00
shayzluf
6c1740eefc Add Caching to Tree Hashing Algorithm (#1929)
* added todo to hash file in ssz

* params and copy of block cache

* start hash cache

* Hash cache implementation

* fixed some comments

* fixed promatheus duplicate counter name

* removed TODO

* change to use special expiration cache

* function name fixes junk object generator

* naming changes

* gazzle fix

* added pruning last read data test

* fixed gometallinter errors

* fix benchmarks and no int64 not serializable

* move struct from test

* add feature flag

* fix merge issues

* add featureflag to beacon and validator

* featureflag init for tests

* added feature flag to all ssz dependent tests

* remove setter func

* replace k8s tweaked expiration cache to https://github.com/karlseguin/ccache

* remove else

* change request by preston

* added init featureflags to genesis_test

* Update shared/ssz/hash_cache.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/ssz/hash_cache.go

remove extra space

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/params/config.go

add dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* Update shared/featureconfig/config.go

remove dot

Co-Authored-By: shayzluf <thezluf@gmail.com>

* remove powchain from prometheus hash cache name

* fixes fron change requests

* fix change requests

* remove faulty merge test

* gazelle fix

* fix fmt.sprintf

* remove debug binary

* fix gazelle
2019-04-24 13:39:02 +08:00
Raul Jordan
7a27d9a227
Move Inclusion Maps to Epoch Processing (#2347)
* fix broken initial sync

* tests pass
2019-04-22 21:30:37 -05:00
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