Commit Graph

5098 Commits

Author SHA1 Message Date
Shay Zluf
3fb78ff575
Verify GenesisValidatorRoot Matches the One in DB on Slashing Protection Import (#7864)
* Add GenValRoot dbs

* Test genvalroot

* Fix names

* Add overwrite rejection

* validate metadata genesis validator root

* remove env

* fix database functions

* fix tests

* raul feedback

Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-20 22:33:51 +00:00
Raul Jordan
7bd97546f0
Dynamic Reloading of Keys on Any FSNotify Event (#7873)
* dynamic import

* add tests

* spacing
2020-11-20 22:04:59 +00:00
Ivan Martinez
5140ceec68
Hotfix for WaitForChainStart GenesisValidatorsRoot Check (#7870)
* Hotfix for genesis val root

* Add regression test

* Fix error message

* Remove comments

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-20 20:53:12 +00:00
terence tsao
97ad5cd5fd
Reduce no attestation in pool to warn (#7863)
* Reduce no attestation in pool to warn

* Use NotFound

* Update validator/client/aggregate.go

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

* Update validator/client/aggregate.go

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2020-11-20 12:17:26 -08:00
Ivan Martinez
4dc65c5787
Save GenesisValidatorsRoot from WaitForChainStart (#7855)
* Add GenValRoot dbs

* Test genvalroot

* Fix names

* Add overwrite rejection

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-20 18:06:12 +00:00
Roy
1b012ccfa5
Various Powershell Fixes (#7854)
* Remove incorrect x64 error message when showing usage description

* Add missing escape characters in usage description

The actual environment variable value would be printed without these
escape characters.

* Add missing quotation marks in usage description

* Also test existence of sha and signature files

For multiple reason the executable could be downloaded, but not the
signature files. Later on the script will error out because these files
are lacking.

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-20 17:17:38 +00:00
Nishant Das
60cdd69b05
Update Gossipsub Parameters (#7869)
* add param and flag

* change back
2020-11-20 15:36:02 +00:00
Preston Van Loon
90a66df529
Update eth2 specs version badge in README (#7865) 2020-11-20 03:21:11 +00:00
Nishant Das
c4a1fe4d0d
Add Basic Support for IP Tracker (#7844)
* add basic support for ip tracker

* clean up

* check for it

* fix

* Update beacon-chain/p2p/peers/status.go

* fix
2020-11-19 12:54:19 +00:00
Nishant Das
8a256de2dd
Check Target Root Better (#7837)
* check better

* bring it down

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-19 11:13:54 +00:00
Nishant Das
c3451a6ce9
Cache ETH1 Headers When Requesting Logs (#7861)
* perform a quick patch

* perform a quick patch

* fix

* fix up

* Update beacon-chain/powchain/service.go

* start caching from here

* remove

* fix
2020-11-19 10:47:31 +00:00
terence tsao
4b6441f626
Pending block queue caching with TTL (#7816)
* Update pending blks queue to ttl one

* Update tests

* Comment

* Gazelle

* Fix fuzz

* More comments

* Fix fuxx import

* Nishant's feedback

* Happy lint

* Return error for len(blks) >= maxBlocksPerSlot

* Ensure proposer time conv

* don't use gcache's default exp time it's 0

* fix TestService_AddPeningBlockToQueueOverMax

* Update beacon-chain/sync/pending_blocks_queue.go

Co-authored-by: Nishant Das <nishdas93@gmail.com>

* Fix time conversion

Co-authored-by: Nishant Das <nishdas93@gmail.com>
2020-11-19 05:15:58 +00:00
Nishant Das
eb7ab16f92
Change Back Metadata Error Check (#7852)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-19 04:17:26 +00:00
Nishant Das
e6ecda5ebe
add check and test (#7853)
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2020-11-19 11:53:24 +08:00
Victor Farazdagi
095c4d5dd5
Peer status peer scorer (#7480)
* define and enforce minimum scorer interface

* better decoupling of multiple scorers in service

* removes redundant weight

* adds peer_status scorer

* minir re-arrangement

* rely on scorer in peer status service

* gazelle

* updates rpc_status

* fix build

* better interface verifying

* remove unnecessary locks

* mark todo

* simplify service

* remove redundant references

* avoid passing contexts

* remove unused context

* refactor errors to p2p package

* refactor goodbye codes into p2p

* simplify status api

* remove isbad method from peers

* update scoring service

* introduce validation error

* gazelle

* add score

* restore isbad method

* resolve dep cycle

* gazelle

* peer status scorer: test score calculation

* bad responses scorer: bad peer score

* remove redundant type checks

* pass nil config

* add rounding

* test IsBadPeer

* test bad peers list

* more tests

* check validation error on non-existent peer

* max peer slot -> highest peer slot

* remove redundant comment

* combine

* combine

* introduce var

* fix tests

* remove redundant update

* minor fix

* Nishant's suggestion

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-18 15:51:42 +00:00
Nishant Das
59d63087b1
Save Powchain Metadata To Disk On Chainstart (#7850)
* save to disk

* log error
2020-11-18 21:44:06 +08:00
Nishant Das
e1dd532af3
handle correctly (#7851) 2020-11-18 21:12:12 +08:00
Ivan Martinez
cfed4fa1b5
Remove listen for ChainStarted in WaitForChainStart (#7849)
* Remove GenValRoot from ChainStarted and remove ChainStarted from WaitForChainStart

* Fix test and add logs
2020-11-18 05:51:00 +00:00
Victor Farazdagi
7735a083b2
Extract common types from sync (#7843)
* extract common types from sync

* fix tests

* simplify

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-18 04:17:42 +00:00
Ivan Martinez
fec469291e
Add GenesisValidatorRoot to ChainStartResponse (#7846)
* Add genesis validator root to chainstartresposne

* Deps

* Tidy

* Fix tests

* Fix test

* Fix test and add to ChainStartedData
2020-11-17 20:15:48 -06:00
Shay Zluf
acb47f2920
Implement Standard Slashing Protection JSON With Importing Logic (#7675)
* Use new attestation protection

* tests fixes

* fix tests

* fix comment

* fix TestSetTargetData

* fix tests

* empty history handling

* fix another test

* mock domain request

* fix empty handling

* use far future epoch

* use far future epoch

* migrate data

* copy byte array to resolve sigbus error

* init validator protection on pre validation

* Import interchange json

* Import interchange json

* reduce visibility

* use return value

* raul feedback

* rename fixes

* import test

* checkout att v2 changes

* define import method for interchange format in its own package

* rename and made operations atomic

* eip comment

* begin amending test file

* finish happy path for import tests

* attempt the interchange import tests

* fixed tests

* happy and sad paths tested

* good error messages

* fix up comment with proper eip link

* tests for helpers

* helpers

* all tests pass

* proper test comment

* terence feedback

* validate metadata func

* versioning check

* begin handling duplicatesz

* handle duplicate public keys with potentially different data, first pass

* better handling of duplicate data

* ensure duplicates are taken care of

* comprehensive tests for deduplication of signed blocks

* tests for deduplication

* Update validator/slashing-protection/local/standard-protection-format/helpers_test.go

Co-authored-by: Shay Zluf <thezluf@gmail.com>

* Update validator/slashing-protection/local/standard-protection-format/helpers_test.go

Co-authored-by: Shay Zluf <thezluf@gmail.com>

* tests for maxuint64 and package level comment

* tests passing

* edge cases pass

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-17 22:37:43 +00:00
terence tsao
925fba0570
Validate beacon block in pending queue (#7847) 2020-11-17 13:50:51 -08:00
dv8silencer
1a72733c53
Handle duplicate keystores in import path without error (#7842)
* bug fix

* Add regression test

* improve wording

* improve wording

* fix test

* comments, wording

* Comment

* import hex output

* fix test

* remove unnecessary sprintf

* fix test

Co-authored-by: dv8silencer <15720668+dv8silencer@users.noreply.github.com>
2020-11-17 13:50:23 -06:00
Shay Zluf
2976bf7723
Source lrg target (#7839)
* handle source > target better

* promatheus metric for source > target

* handle source > target well in sig bytes

* Update slasher/detection/attestations/spanner_test.go

* Update slasher/detection/attestations/spanner_test.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-17 17:17:21 +00:00
terence tsao
7c54cfea3f
Hardening unaggregated attestation queue check (#7834)
* Add more checks and tests

* Move VerifyLmdFfgConsistency

* Move VerifyFinalizedConsistency

* Move VerifyFinalizedConsistency higher

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-17 16:31:43 +00:00
Fabrice Cheng
d3f8599d19
Add indicator for disabled accounts in account list (#7819)
* add indicator for disabled accounts in `account list`

* add also the account name in red for disable accounts

* bold disable as well

* Update validator/accounts/accounts_list.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-17 09:58:53 -06:00
Victor Farazdagi
2034c662af
Refactor scoring service (#7841)
* refactor scoring service

* fix anti-pattern issue

* add block providers bad peers detection tests

* check status when peer scoring is disabled

* more tests
2020-11-17 23:28:13 +08:00
terence tsao
ad5151f25d
Hardening aggregated attestation queue check (#7826) 2020-11-17 07:25:18 +00:00
Raul Jordan
f75a8efc0d
Remove Keymanageropts Pattern from Wallets and Remove Enable/Disable Feature for V1 CLI (#7831)
* rem opts

* rem more km opts

* more removal of km opts

* removal of km opts

* definition of internal accounts store

* refactor enable/disable

* enable build

* fix rpc

* remove keymanageropts

* fix imported tests

* table driven tests for enable disable

* table driven tests for disable

* comprehensive tests for disable

* tests complete for enable and disable

* pass enable disable tests

* clarify imported

* fix deadlocks

* imported tests pass

* remove enable disable entrypoints

* better derived text

* deep source suggestions

* gaz

* tidy

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-17 06:00:20 +00:00
Nishant Das
39817c0586
Add Back Flag to Subscribe to All Subnets (#7836) 2020-11-17 05:25:35 +00:00
Nishant Das
168cffb0dd
Check Sub Group for Herumi and Fix Edge Cases (#7823)
* check for herumi

* clean up

* fix tests

* fix
2020-11-17 04:12:23 +00:00
yorickdowne
194ee7c439
Add --mainnet no-op to validator sub-commands (#7833)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-17 03:17:08 +00:00
Ivan Martinez
5889670cc7
Remove WaitForSynced (#7835)
* Remove waitforsynced

* Remove WaitForsynced entirely

* Fix bazel

* tidy
2020-11-16 20:48:16 -06:00
Raul Jordan
7449eba612
Refactor HD Wallets for Enhanced Security (#7821)
* begin hd wallet refactor

* further simplify the new derived keymanager

* make it almost a full wrapper around an imported keymanager

* fix up the EIP test

* deprecated derived

* fixing keymanager tests

* fix up derived tests

* refactor initialize keymanager

* simplify hd

* pass some tests

* pass accounts list test

* gaz

* regenerate protos without create account privilege

* enforce account recovery on wallet create

* allow accounts delete to work

* remove mentions of accounts create

* resolve comments and go mod

* fix up tests

* build fixes

* remove insecure warning

* revert

* fix proto file

* remove create account message

* gaz

* remove account create

* update web api protos

* fix up imports

* change func sig

* tidy

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2020-11-16 22:26:04 +00:00
Preston Van Loon
d85cf028ef
Update go-pbs after v1 changes (#7830) 2020-11-16 21:14:04 +00:00
terence tsao
71c6164c42
Remove a few old metrics (#7825) 2020-11-16 18:27:41 +00:00
Nishant Das
83601245f2
update geth (#7824) 2020-11-16 09:29:08 -06:00
james-rms
758ec96d6d
beacon-chain: fix segfault (#7822)
Observed this segfault running all tests on mater, occurring
in around 2-3 out of 10 test runs.

```
FAIL: //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10) (see /home/j/.cache/bazel/_bazel_j/1ba834ca9d49f27aeb8f0bbb6f28fdf3/execroot/prysm/bazel-out/k8-fastbuild/testlogs/beacon-chain/sync/go_default_test/shard_3_of_4_run_1_of_10/test.log)
INFO: From Testing //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10):
==================== Test output for //beacon-chain/sync:go_default_test (shard 3 of 4, run 1 of 10):
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x138eea6]

goroutine 1660 [running]:
github.com/prysmaticlabs/prysm/shared/abool.(*AtomicBool).IsSet(...)
	shared/abool/abool.go:39
github.com/prysmaticlabs/prysm/beacon-chain/sync.(*Service).subscribeStaticWithSubnets.func1(0xc002dd4400, 0xc002990940, 0x17bca26, 0x1e)
	beacon-chain/sync/subscriber.go:207 +0xe6
created by github.com/prysmaticlabs/prysm/beacon-chain/sync.(*Service).subscribeStaticWithSubnets
	beacon-chain/sync/subscriber.go:200 +0x172
================================================================================
```

TestStaticSubnets was testing a Service with an uninitialized
chainStarted value. This commit initializes chainStarted explicitly
in all tests that construct a Service. This reduces the observed flake
rate to 0/10 runs. This was verified with:

```
./bazel.sh test //beacon-chain/sync:go_default_test --runs_per_test 10
```
2020-11-16 12:10:34 +01:00
terence tsao
977e539fe9
Loadblock returns err on invalid range (#7811)
* Return error on invalid range and fix tests

* Uncomment some test codes

* Update comment

* Sync with master, fixed more tests

* Rm error condition, update comments, tests
2020-11-16 01:06:13 +00:00
Victor Farazdagi
f361450e8d
Update TestMain() to use os.Exit() (#7814)
* update TestMain

* fix sync/initial-sync test

* restore code in rate limiter

* fix rate_limiter tests
2020-11-13 18:28:14 -08:00
Preston Van Loon
0c9389a438
Fix instances of "The result of append is not used anywhere SCC-SA4010" (#7812) 2020-11-13 22:54:12 +00:00
terence tsao
f200a16418
Update Prymont config (#7808) 2020-11-13 11:16:07 -08:00
Raul Jordan
28ad21c410
Simplify Terms of Service Log (#7809) 2020-11-13 17:25:05 +00:00
Ivan Martinez
da835afbaf
Add Partial Deposits in E2E (#7801)
* Partial Deposits in E2E

* Undo changes made to evaluator

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2020-11-13 16:35:09 +00:00
Fabrice Cheng
16bccf05cf
[Feature] enable/disable validator accounts (#7746)
* add --enable --disable flags for validator accounts

* refactor DeleteAccountConfig into AccountConfig to be used for enable and disable feature

* add `disable` flag for validator accounts

* [wip] add method to disable account

* refactor account delete

* add disable & enable with proper filters

* fix keymanager unit tests

* update DisabledPublicKeys to be a string instead of [][]byte

* fix FetchValidatingPrivateKeys to only fetch active keys with new string format

* fix FetchValidationPrivateKeys with new DisabledPublicKeys format (as a string)

* rename file + update AccountsConfig to include Disable, Enable and Delete distinct attributes

* rename accounts_activation -> accounts_enable_disable

* revert changes from using string to [][]byte for DisabledPublicKeys

* add FetchAllValidatingPublicKeys to preserve the functionality for accounts list, backup and delete

* fix unit tests

* convert publickeys from [][]byte to str before passing it to pb message

* add unit tests for disable keys

* add unit tests for EnableAccounts

* revert WORKSPACE LLM for now

* ran gazelle

* move function to convert KeymanagerOpts to Config inside rpc and run gazelle

* add unit tests for FetchAllValidatingPublicKeys

* fix keymanageropts for InteropKey

* Fix mistake for enable accounts

* add docstring to DisableAccountsCli and EnableAccountsCli

* remove previous testnet and add toledo & pyrmont
2020-11-13 10:06:24 -06:00
Nishant Das
8dcdfea2a8
Make Blst the Default Library (#7805)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2020-11-13 15:25:05 +00:00
Nishant Das
244d9633af
Update Go-Ethereum Dependency (#7804)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-13 14:52:27 +00:00
Nishant Das
d281ef9c56
Clean Up GoodByes (#7790)
* clean up

* cleanup

* fix

* fix tests

* change

* deepsource

* fix test
2020-11-13 12:58:13 +00:00
Nishant Das
58fcb52220
Fix Windows Builds For Blst (#7803)
* checkpoint

* fixWindowsBuils add transitive includes to mingw toolchain

* comment

Co-authored-by: SuburbanDad <gts.mobile@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-13 07:17:39 +00:00
Preston Van Loon
8d50fa10e6
Remove testnets prior to spec v1.0.0 (#7802) 2020-11-13 06:42:33 +00:00