Commit Graph

4506 Commits

Author SHA1 Message Date
terence tsao
9ebd90c324
Use LRU for checkpoint state cache (#7010)
* DB: add block roots test

* Pool: add seen atts map

* Pool: use seen atts map

* Pool: clear seen map

* Core: optimize InitiateValidatorExit

* Cache: checkpoint state uses LRU

* Cache: use it

* Cache: update tests

* Cache: typo

* Gaz
2020-08-16 07:36:37 -07:00
terence tsao
03c3f06288
Core: optimize InitiateValidatorExit and ProcessAttesterSlashings (#7008)
* Core: optimize InitiateValidatorExit

* Core: optimize

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-08-15 14:01:46 -05:00
terence tsao
c47d18aa0b
Featureflag test: reset init (#7007)
* Featureflag: properly init test
* Merge refs/heads/master into fix-feature-test
2020-08-15 15:48:12 +00:00
Nishant Das
17b810f24e
Fix 2nd Stage of Sync (#7006)
* handle 2nd stage better
* 2 stage sort
* add warning
* better processing
* victor's review
* fix one test
* Update beacon-chain/blockchain/receive_block.go
* fixes TestService_roundRobinSync/Multiple_peers_with_many_skipped_slots
* Merge branch 'fixSync' of github.com:prysmaticlabs/prysm into fixSync
* fixes TestService_process
* fixes TestService_blockProviderScoring
* Preston's suggestion
* increase number of available slots, allowing 2nd phase to wrap up
* more concise limits
2020-08-15 15:14:59 +00:00
Nishant Das
ee2ba721ab
Initialize Config Correctly (#7004)
* initialize correctly
2020-08-15 01:37:57 +00:00
Noah Citron
d24f99d66d
added flag to enable roughtime syncing, with it disabled by default (#6898)
* added flag to enable roughtime syncing, with it disabled by defaults

* gofmt

* switched to feature flag

* enable-roughtime works correctly

* enable-roughtime works correctly

* Gaz

* Remove conflict

* fix roughtime enable

Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com>
Co-authored-by: rauljordan <raul@prysmaticlabs.com>
2020-08-14 14:22:58 -05:00
Raul Jordan
3c776f4e76
Fix Validator RPC JWT Response (#7001)
* fix jwt response
* fix jwt parse
* ken naming
* gaz
2020-08-14 16:30:11 +00:00
terence tsao
b981442022
Register health APIs handler (#6999)
* DB: add block roots test
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* Pool: add seen atts map
* Pool: use seen atts map
* Pool: clear seen map
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* RPC: register health endpoint
* Gazelle
2020-08-14 15:18:04 +00:00
Victor Farazdagi
6db448a81d
Uncomments tests in kv/unaggregated_test (#6997)
* uncomments tests in kv/unaggregated_test
2020-08-14 07:23:42 +00:00
Raul Jordan
f5a1a8b4ed
Integrate Validator RPC Server Into Runtime + Add Gateway (#6994) 2020-08-13 19:49:57 -07:00
terence tsao
3df2980cba
Add and utilize seen atts map (#6993)
* DB: add block roots test

* Pool: add seen atts map

* Pool: use seen atts map

* Pool: clear seen map

* Gazelle

* Fixed an existing test

Co-authored-by: rauljordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-08-13 16:52:27 -05:00
Raul Jordan
16c34b627f
Add Authentication Functions to Validator RPC (#6968)
* define auth endpoints
* add intercepter with tests
* auth functions
* fix up the auth functions
* add functions for storing and saving the hashed password from the validator db
* validate strong password input and simplify jwt claims
* tests for db funcs
* comments for db funcs
* wrap up the authentication tests
* register auth srv
* use proper db iface package and check if existing password
* fix broken tests and add new test to check if password already exists
* use roughtime
* rlock to check the auth paths
* Merge refs/heads/master into auth-rpc
* Merge refs/heads/master into auth-rpc
* Merge refs/heads/master into auth-rpc
* leave out the stream interceptor
* resolve confs
* Merge branch 'master' into auth-rpc
* confs
* Merge branch 'auth-rpc' of github.com:prysmaticlabs/prysm into auth-rpc
* Merge refs/heads/master into auth-rpc
* Merge refs/heads/master into auth-rpc
* Merge refs/heads/master into auth-rpc
* Merge refs/heads/master into auth-rpc
2020-08-13 20:27:42 +00:00
Ivan Martinez
6ed0539723
Acconuts-V2: Allow importing from any valid keystore, regardless of name (#6992)
* Allow importing from any file

* Fix log

* Add test

* Fix test
2020-08-13 14:45:56 -05:00
Victor Farazdagi
4de0b9fe69
Peer scoring: init sync (#6709)
* refactors redundant part of varname
* introduces score_block_providers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* gazelle
* adds comment
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* removes redundant checks
* add block provider decay test
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* adds case
* penalize inactive peers
* adds scorebadresponses test
* inroduces no-activity penalty
* gazelle
* gofmt
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* expanded tests
* implement SortBlockProviders
* change -> update
* updates block fetcher peer filter
* fixes test
* allows to keep track of peer id
* updates scoring coefficients
* fixes test
* block fetcher update
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* disables empty batch penalty
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* removes outdated code
* update filterPeers
* gazelle
* updates var
* revert changes to var name
* updates blocks_fetcher
* minor fix to import name
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* add max processed blocks cap
* impoves scoring of stale peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* fixes test
* adds weight sorting to scored peers
* return pid when fetching batches
* updates round robin
* gazelle
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* updates block provider decay count
* go tidy
* cherry pick
* fixes test
* go tidy
* Merge branch 'peer-scorer-weighted-sorter' into init-sync-peer-scoring-slow-peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* refactors blocks fetcher: repackage methods
* Merge branch 'refactor-blocks-fetcher' into init-sync-peer-scoring-slow-peers
* minor fixes
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* allow scores in range (0;1) in weighted filter
* filterScoredPeers improve test suite
* puts feature behind the flag
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* fixes tests
* Merge branch 'init-sync-peer-scoring-slow-peers' of github.com:prysmaticlabs/prysm into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Merge branch 'master' into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Update beacon-chain/sync/initial-sync/blocks_fetcher_test.go

Co-authored-by: Shay Zluf <thezluf@gmail.com>
* Nishant's suggestion on peer limit variable
* better explanation of non-blocking peer scoring
* Shay's sugession on peer naming
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Update beacon-chain/sync/initial-sync/blocks_fetcher.go

Co-authored-by: Nishant Das <nishdas93@gmail.com>
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* gofmt
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
* Merge refs/heads/master into init-sync-peer-scoring-slow-peers
2020-08-13 17:33:57 +00:00
Nishant Das
282398fd13
Add in Attestation Validity Check (#6983)
* fix bad bug
* add test
* Merge refs/heads/master into fixAttestationNoVerify
* Merge refs/heads/master into fixAttestationNoVerify
* target
* Merge branch 'fixAttestationNoVerify' of https://github.com/prysmaticlabs/geth-sharding into fixAttestationNoVerify
* add cheap check
* Merge refs/heads/master into fixAttestationNoVerify
* Merge refs/heads/master into fixAttestationNoVerify
* Merge refs/heads/master into fixAttestationNoVerify
* Merge refs/heads/master into fixAttestationNoVerify
* Merge refs/heads/master into fixAttestationNoVerify
2020-08-13 16:58:28 +00:00
Victor Farazdagi
74101612ce
Moves AssertLogsContains to assertions package (#6985)
* first working implementation
* assertions tests
* adds to requires
* merges assert and require tests into a single suite
* gazelle
* Merge branch 'merge-assert-require-tests' into assert-logs-contains-move-to-assertions
* gazelle
* updates references
* fixes build issue
* Merge branch 'master' into assert-logs-contains-move-to-assertions
* Merge refs/heads/master into assert-logs-contains-move-to-assertions
* Merge branch 'master' into assert-logs-contains-move-to-assertions
* fixes build issue
* Merge branch 'assert-logs-contains-move-to-assertions' of github.com:prysmaticlabs/prysm into assert-logs-contains-move-to-assertions
* Merge refs/heads/master into assert-logs-contains-move-to-assertions
* Merge refs/heads/master into assert-logs-contains-move-to-assertions
2020-08-13 16:22:25 +00:00
terence tsao
308dbc4272
ListStatuses for validator RPC (#6987)
* DB: add block roots test
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* Client: support ValidatorPubkeysToStatuses getter
* RPC: implement ListStatuses
* RPC: tests
* Merge branch 'master' into health-apis
* Update an existing test
* Merge branch 'health-apis' of github.com:prysmaticlabs/prysm into health-apis
* Merge refs/heads/master into health-apis
2020-08-13 15:52:56 +00:00
Ivan Martinez
5705a9a1f9
Accounts-V2: Add test for DeleteAccounts (#6982)
* Add test for DeleteAccounts
* attempt to fix
* Try to fix test
* Remove
* fixed Ivan's test
* Merge branch 'master' into add-delete-test
2020-08-13 15:23:08 +00:00
Nishant Das
72bbc33a65
Fix Validator Exits (#6986)
* add change
* Update beacon-chain/core/blocks/exit.go

Co-authored-by: Shay Zluf <thezluf@gmail.com>
* Merge refs/heads/master into fixExits
2020-08-13 14:37:38 +00:00
Victor Farazdagi
dc752fb945
Merges assert and require tests into a single suite (#6984)
* merges assert and require tests into a single suite
* gazelle
2020-08-13 13:57:29 +00:00
Victor Farazdagi
0c94298847
Peer scorer: fix weighted sorting (#6981)
* peer scorer: fix weighted sorting
* Merge refs/heads/master into minor-fixes-to-peer-scorer
* Merge refs/heads/master into minor-fixes-to-peer-scorer
2020-08-13 09:36:50 +00:00
Victor Farazdagi
7611f6d84a
injects peer.ID into requested/queued/fetched batches (#6979)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-08-13 16:42:21 +08:00
terence tsao
49549f4687
ListBalances for validator RPC (#6975)
* DB: add block roots test

* Node: register RPC service

* RPC: access to client service

* Client: add balances and pubkeys -> indices getters

* Update validator/client/metrics.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>

* Lint and feedbacks

* Fix lock to prevent a run time panic

* Fixes existing tests

* Validator: add mock for testing

* Validator: Add pubkeys to indices getter

* RPC: tests tests tests

* Lint

* Lint

* Lint

* Lint

* Lint

* Gazelle

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-08-12 18:33:15 -05:00
terence tsao
0d7ea33298
DB: add block roots test (#6974) 2020-08-12 11:28:52 -05:00
Javed Khan
2400536a8e
Update sendDepositTx tool (#6972)
* Update sendDepositTx contract address

* Use Medalla config in sendDepositTx

* Update sendDepositTx  - geth not necessary
2020-08-12 22:15:37 +08:00
Victor Farazdagi
da4e96047b
go syntax representation of the value in DeepEqual assertions (#6970) 2020-08-12 17:46:56 +08:00
terence tsao
f4d808a542
Validator web RPC skeleton (#6967)
* Proto: remove unused ethapi imports
* Validator: web rpc
* Lint
* Sync with master
* Merge refs/heads/master into web-rpc
* rename
2020-08-12 01:38:01 +00:00
Raul Jordan
86b2bd5edd
Implement Accounts-V2 Backup for Direct Keymanager (#6936)
* progress on export feature
* Merge branch 'master' into impl-export
* rename func
* imports
* confs
* export single works
* impl export
* Merge branch 'master' into impl-export
* cleanup exports code
* rename to backup
* rename to backup
* Merge branch 'master' into impl-export
* full test for backup
* Merge branch 'impl-export' of github.com:prysmaticlabs/prysm into impl-export
* gazelle fix
* terence feedback
* merge confs
* Merge branch 'master' into impl-export
* refactor into single select accounts function
* gaz
* Merge refs/heads/master into impl-export
* victor's feedback
* validate yes or no
* confs
* close the zip file in defer
* Merge refs/heads/master into impl-export
* Merge refs/heads/master into impl-export
2020-08-11 23:15:06 +00:00
terence tsao
682401c6b0
Health related web api protos (#6965)
* Proto: first attempt of account related web api protos
* Proto: health related web api protos
* Merge branch 'master' of github.com:prysmaticlabs/prysm into validator-protos-1
* Merge branch 'master' of github.com:prysmaticlabs/prysm into validator-protos-1
* Sync with master
* @rauljordan's feedback
2020-08-11 22:33:03 +00:00
terence tsao
4499fb2ed0
First attempt of account related web api protos (#6964) 2020-08-11 13:23:16 -07:00
terence tsao
46cb3abe2e
Add and use genesis time in config (#6966)
* Config: add genesis time and update medalla

* Helper: add GenesisTime getter

* Rest: use the helper
2020-08-11 14:36:32 -05:00
Raul Jordan
11c9699129
Allow Importing One-Off, Private Keys Into Accounts-v2 (#6929)
* import privkey done
* rem print
* tidy
* Merge refs/heads/master into import-priv-key
* Merge refs/heads/master into import-priv-key
* Merge branch 'master' into import-priv-key
* tests pass
* Merge refs/heads/master into import-priv-key
* Merge refs/heads/master into import-priv-key
* resolve confs
* Merge refs/heads/master into import-priv-key
* confs
* Merge refs/heads/master into import-priv-key
* better feedback mechanism
2020-08-11 16:32:05 +00:00
Victor Farazdagi
c24666e02e
refactors blocks fetcher: repackage methods (#6962) 2020-08-11 10:15:18 -05:00
Victor Farazdagi
a279f374bc
Move to opt-out attestation-aggregation-strategy flag (#6960)
* inverts attestation-aggregation-strategy flag
* Merge refs/heads/master into att-aggregation-opt-out-flag
* marks deprected flag as hidden
* Merge branch 'att-aggregation-opt-out-flag' of github.com:prysmaticlabs/prysm into att-aggregation-opt-out-flag
* Merge refs/heads/master into att-aggregation-opt-out-flag
2020-08-11 12:42:08 +00:00
rkapka
a5f0fd29fc
Fix antipatterns (#6961)
* Merge variable declaration and assignment
* Use result of type assertion to simplify cases
* Replace call to bytes.Compare with bytes.Equal
* Drop unnecessary use of the blank identifier
* Replace x.Sub(time.Now()) with time.Until(x)
* Function literal can be simplified
* Use a single append to concatenate two slices
* Replace time.Now().Sub(x) with time.Since(x)
* Omit comparison with boolean constant
* Omit redundant nil check on slices
* Nested if can be replaced with else-if
* Function call can be replaced with helper function
* Omit redundant control flow
* Use plain channel send or receive
* Simplify returning boolean expression
* Merge branch 'origin-master' into fix-antipatterns
* Merge branch 'master' into fix-antipatterns
* Merge branch 'origin-master' into revert-single-channel-antipattern
* Revert "Use plain channel send or receive"

This reverts commit b3108fdc3a656a9c9b1823409dc6a263e69f9e92.
2020-08-11 12:14:28 +00:00
Nishant Das
b32ccce23d
Remove Checked In Metadata File (#6959)
* Delete metaData
2020-08-11 11:26:59 +00:00
Nishant Das
3893ee43f9
support domains in discoveryV5 (#6958) 2020-08-11 18:33:27 +08:00
Ivan Martinez
ea9bb88d13
Accounts-V2: Add command to delete accounts (#6941)
* Add accounts-v2 delete
* Merge branch 'master' of github.com:prysmaticlabs/prysm into add-delete-command
* Gaz
* Add confirmation
* Fix build
* Fix test
* Merge branch 'master' into add-delete-command
* Add more cases for exit
* Merge branch 'master' of github.com:prysmaticlabs/prysm into add-delete-command
* Fix usage
* Fix logs
* Change to DeleteAccounts
* Remove flag
* Fix comment
2020-08-11 03:54:37 +00:00
terence tsao
537fe3f721
Fix loading historical blocks to replay cold state (#6956)
* Replay: cold state only uses finalized blocks
* Replay: regression test
* Merge refs/heads/master into fix-finalized-replay
2020-08-10 23:35:28 +00:00
Ivan Martinez
8b9138a76a
Accounts V2: Log and UX cleanup (#6955)
* Clena up password entry for importing
* Merge branch 'master' of github.com:prysmaticlabs/prysm into accounts-v2-cleanup
* Fix password entry
* Clean
* Merge branch 'master' of github.com:prysmaticlabs/prysm into accounts-v2-cleanup
* Change color
* Merge branch 'master' of github.com:prysmaticlabs/prysm into accounts-v2-cleanup
* Fix
* Merge branch 'master' of github.com:prysmaticlabs/prysm into accounts-v2-cleanup
* Fix
* Merge branch 'master' of github.com:prysmaticlabs/prysm into accounts-v2-cleanup
* Cleanup
* Clean go.mod
* Fix
2020-08-10 22:35:30 +00:00
terence tsao
ceb11f432e
Proposer: log graffiti (#6954)
* Proposer: log graffiti
* Merge refs/heads/master into log-graffiti
2020-08-10 19:17:59 +00:00
Raul Jordan
cbc27e0f2e
Refactor Wallet Password Handling, Preventing Wallet Corruption (#6933)
* wallet should no longer deal with account passwords
* ensure tests are fixed
* Merge branch 'master' into corrupted-pass
* move mnemonic logic into right place
* rem fmts
* add fileutil
* gazelle
* imports
* move seed logic to derived
* fix tests
* imports
* gaz
* Merge refs/heads/master into corrupted-pass
* merge confs
* Merge refs/heads/master into corrupted-pass
* ivan's feedback
* Merge branch 'corrupted-pass' of github.com:prysmaticlabs/prysm into corrupted-pass
* gaz
* fix shared test
* Merge refs/heads/master into corrupted-pass
* resolve conflicts
* fix test build
2020-08-10 18:54:40 +00:00
Raul Jordan
a7f4293eb3
Resolve Accounts-v2 Feedback (#6953)
* Radek feedback
* Merge refs/heads/master into final-accounts-feedback
* Apply suggestions from code review
* Merge refs/heads/master into final-accounts-feedback
* Merge refs/heads/master into final-accounts-feedback
2020-08-10 18:14:10 +00:00
Shay Zluf
335d31688f
Wallet file lock (#6952)
* Wallet file lock

* lock wallet config file only in validator instance

* runtime fixes

* added test

* radek feedback

* fix test
2020-08-10 12:48:41 -05:00
Raul Jordan
95fd399dbe
Change Log Level of Genesis Time Info Log in RPC (#6920)
* lvl debug
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* tidy
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* Merge refs/heads/master into change-log-level
* fix log level error
* victor feedback
* Merge refs/heads/master into change-log-level
2020-08-10 16:52:49 +00:00
rkapka
1f21e196b6
Fix multiple anti-patterns from DeepSource analysis (#6951)
* Merge variable declaration and assignment
* Use result of type assertion to simplify cases
* Replace call to bytes.Compare with bytes.Equal
* Drop unnecessary use of the blank identifier
* Replace x.Sub(time.Now()) with time.Until(x)
* Function literal can be simplified
* Use a single append to concatenate two slices
* Replace time.Now().Sub(x) with time.Since(x)
* Omit comparison with boolean constant
* Omit redundant nil check on slices
* Nested if can be replaced with else-if
* Function call can be replaced with helper function
* Omit redundant control flow
* Use plain channel send or receive
* Simplify returning boolean expression
* Merge branch 'origin-master' into fix-antipatterns
* Merge branch 'master' into fix-antipatterns
2020-08-10 16:16:45 +00:00
Preston Van Loon
18b3203f31
Wait for subnet peers before broadcasting onto attestation subnet topic (#6893)
* Initial pass

* Add metric to measure success

* Use a subnet RWLock to prevent duplicate requests, give up after 3 attempts

* push latest commented code

* try with non-blocking broadcast

* Add feature flag, ignore parent deadline if any

* Add slot as metadata

* add tests

* gaz

Co-authored-by: nisdas <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-08-10 10:27:50 -05:00
rkapka
33105f1bbc
Simplify make call by omitting redundant arguments (#6949)
* removed redundant args
* Merge refs/heads/master into omit-redundant-make-args
2020-08-10 11:06:53 +00:00
Victor Farazdagi
44f9d07434
Applies assertion funcs to beacon-chain/core/* tests (#6940)
* beacon-chain/core/blocks/spectest tests updated
* beacon-chain/core/blocks tests updated
* beacon-chain/core/epoch tests updated
* Merge branch 'master' into apply-testutils-assertions-to-core
* beacon-chain/core/helpers tests updated
* beacon-chain/core/validators tests updated
* beacon-chain/core/state/spectest tests updated
* beacon-chain/core/state tests updated
* Merge refs/heads/master into apply-testutils-assertions-to-core
* Merge refs/heads/master into apply-testutils-assertions-to-core
* Merge refs/heads/master into apply-testutils-assertions-to-core
* Merge refs/heads/master into apply-testutils-assertions-to-core
* Merge refs/heads/master into apply-testutils-assertions-to-core
2020-08-10 10:34:33 +00:00
Nishant Das
649bfb58e5
Invert State Locks Flag (#6922)
* invert flag

* Update shared/featureconfig/flags.go

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-08-10 13:10:41 +08:00