Commit Graph

5676 Commits

Author SHA1 Message Date
Raul Jordan
2634430f67
Update Go-Ethereum Dependency (#8788) 2021-04-20 06:57:26 -07:00
terence tsao
70dc22aa9a
Fix redundant err check (#8790) 2021-04-20 02:25:16 +00:00
Everest Stefan Munro-Zeisberger
ad269ee147
Set up Prysm for fuzz testing on Fuzzbuzz (#8789)
* Wrap beacon fuzz tests in go-fuzz compatible test functions

* Add fuzzbuzz.yaml
2021-04-19 19:00:46 +00:00
Nishant Das
cff7dbd015
Add Eth1 Header Timestamp Check (#8771)
* add time check

* unit test

* fix

* Update beacon-chain/powchain/service.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2021-04-17 13:55:41 +00:00
Preston Van Loon
afc0ace624
POW: remove context from log message (#8782) 2021-04-16 19:16:36 +00:00
terence tsao
400e42cc2d
Reuse ProcessBlockForStateRoot (#8781) 2021-04-16 10:18:59 -07:00
Victor Farazdagi
59ee339497
Move TestMain into dedicated file (#8779)
* Move TestMain into dedicated file

* update db_test

* formatting
2021-04-16 16:25:28 +00:00
Radosław Kapka
c53d0e1c5f
Codecov: ignore testing directories (#8777)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-16 08:44:36 -05:00
Raul Jordan
02a8ae7f36
Validator RPC Accounts Voluntary Exit (#8776)
* begin voluntary exits RPC

* added in exit logic

* complete exit func

* revert

* capitalize

* revert

* import

* rpc voluntary exit test

* fmt
2021-04-16 09:46:38 +02:00
terence tsao
a4ff97d24b
Refactor signature function's argument (#8773) 2021-04-15 11:35:53 -07:00
Victor Farazdagi
3d3b9d1217
Spec checker tool (#8722)
* Add specdocs static code analyzer

* docs pulling script

* update content pulling script

* add test

* better parsing of incoming docs

* update test

* implements analyzer

* separate tool

* remove analyzer code

* cleanup

* deep source fixes

* untrack raw specs files

* add back phase0 defs

* update spec texts

* re-arrange code

* updated spec list

* cleanup

* more comments and readme

* add merkle proofs specs

* add extra.md

* mark wrong length issue

* update readme

* update readme

* remove non-def snippets

* update comment

* check numrows

* ignore last empty line

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-04-15 14:54:07 +00:00
terence tsao
169cd78bbd
Refactor process operation function arguments (#8767)
* Pass slash validator func as argument

* Refactor ProcessBlockHeaderNoVerify

* Refactor Eth1Data and Randao

* Refactor ProposerSlashing

* Refactor AttesterSlashing

* Refactor VoluntaryExit

* Add VerifyNilBeaconBlock to ProcessBlock

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-04-15 13:58:54 +00:00
Nishant Das
405e2a1a03
Thread Context for HTR Methods (#8770)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2021-04-15 12:17:55 +00:00
Shay Zluf
d77c298ec6
Support authorised access to web 3 providers (#8075)
* jwt access token impl

* use secret or jwt

* rename

* separate method for splitting auth

* usage update

* Update beacon-chain/flags/base.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Update beacon-chain/node/node.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* make things work

* removed unused code

* better, more flexible authorization

* move types and function to proper packages

* fix checking if endpoint is not set

* fix existing tests

* rename Endpoint field to Url

* Tests for HttpEndpoint

* better bearer auth

* tests for endpoint utils

* fix endpoint registration

* fix test build

* move endpoint parsing to powchain

* Revert "fix existing tests"

This reverts commit ceab192e6a78c106cf4e16a1bdf5399752a39890.

* fix field name in tests

* gzl

* add httputils dependency

* remove httputils dependency

* fix compilation issue in blockchain service test

* correct endpoint fallback function and tests

* gzl

* remove pointer from currHttpEndpoint

* allow whitespace in auth string

* endpoint equality

* correct one auth data Equals test case

* remove pointer receiver

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-04-15 11:02:02 +00:00
Radosław Kapka
2c6549b431
Tests for beacon-chain/node/config.go (#8769)
* Tests for `beacon-chain/node/config.go`

* gzl

* change tested value of NetworkID
2021-04-15 10:01:50 +00:00
Radosław Kapka
aba2ec9aac
Codecov: ignore all mock files (#8768) 2021-04-15 15:55:12 +08:00
Radosław Kapka
a8716d2949
Implement ListForkChoiceHeads in the debug API (#8675)
* initial implementation

* use ChainHeads to get heads

* API unit tests

* remove unnecessary identifier

* fix formatting

* gzl

* Update chainheads to fork choice scope

* use HeadFetcher

* fix test

* gzl

* remove junk

* remove ChainHeads from forkchoice

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-04-14 17:01:24 +00:00
Siddhant N Trivedi
04bc8a85ca
Add generated file to DeepSource exclude_patterns (#8765) 2021-04-14 14:06:25 +00:00
Radosław Kapka
a9a0ecd76d
Create node's Powchain registration file (#8754)
* extract powchain and remove unused function

* improve "no web3 provider" error log

* add second error log

* remove redundant code from registerPOWChainService

* remove deposit contract log from registerPOWChainService

* gzl

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-04-14 12:54:50 +02:00
Radosław Kapka
902e3f4f53
Fix overriding network config in tests (#8756)
* Fix overriding network config in tests

* copy config in OverrideBeaconNetworkConfig

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-04-14 07:39:20 +00:00
terence tsao
228033f7a3
Pass SlashValidator func as argument to ProcessProposer[Attester]Slashings (#8763)
* Pass slash validator func as argument

* Gazelle
2021-04-13 20:32:49 -05:00
Victor Farazdagi
53ffc67850
Update specs comments (#8759)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 22:26:39 +00:00
terence tsao
59eb2e60d0
Combine function parameters (#8758)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 19:56:28 +00:00
Nishant Das
0ea11ac212
Rebuild Trie After Reaching Limit (#8740)
* fix up indices

* add comment

* fix up again

* add test

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 19:12:56 +00:00
terence tsao
3e686a71e3
Move finality delay calculation (#8757)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 18:28:46 +00:00
Preston Van Loon
efbefaeb7c
CI: Use experimental_remote_asset_api (#8761) 2021-04-13 17:18:47 +00:00
Nishant Das
dd7481e99c
Disable Persisting Network Keys (#8735)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 16:25:35 +00:00
Preston Van Loon
fda003288d
CI: minimal remote downloads, strict action environment (#8760) 2021-04-13 15:45:43 +00:00
Nishant Das
131a14ee2f
Minor State Management Improvements (#8742)
* add improvement

* change to bool

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 13:23:06 +00:00
Nishant Das
45d2df1af7
Simplify Effective Balance Calculation (#8743)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 12:44:33 +00:00
Victor Farazdagi
5f3299e598
Update processJustificationAndFinalization(), per current specs (#8741) 2021-04-13 11:51:04 +00:00
Radosław Kapka
5217081567
Create node's P2P registration file (#8745)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 07:41:06 +00:00
Radosław Kapka
389bad7d24
Extract node configuration to separate file (#8744)
* Extract node configuration to separate file

* rename WarnIfNotSupported

* rename configuration to config

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 07:04:34 +00:00
Victor Farazdagi
97b4b86ddf
Update NextPowerOf2() and PrevPowerOf2() funcs (#8751)
* Update NextPowerOf2() and PrevPowerOf2() funcs

* gofmt

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 06:09:56 +00:00
Victor Farazdagi
cc9bec7a19
Update specs comments (#8750)
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 05:35:22 +00:00
terence tsao
8b494fb1bc
ProcessRewardsAndPenaltiesPrecompute taking in rewards funcs (#8737)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 04:55:45 +00:00
Nishant Das
6aa1297829
Enable Gossip Scoring (#8730)
* enable gossip scoring

* fix some tests

* fix  up

* handle too small numbers

* add caching to validator count

* fix up

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-13 02:20:13 +00:00
Preston Van Loon
a91f2688f1
Set test timeout on //beacon-chain/rpc/validator:go_default_test. Sometimes exceeds 800s otherwise (#8752) 2021-04-13 00:24:04 +00:00
terence tsao
1c1bf37b33
Refactor EligibleForRewards into its own helper (#8739)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-12 20:26:08 +00:00
Preston Van Loon
76e36b95f7
CI: Add remote build caching support (#8748) 2021-04-12 18:46:11 +00:00
terence tsao
74cf2320ad
Altair: Split no verify functions in own file (#8747)
* Split transition no verify functions in its own file

* Remove redeclared functions

* Go fmt

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-04-12 16:42:08 +00:00
terence tsao
2a1c880673
Altair: Split state getters and setters into its own file (#8746)
* Categorize getters and setters into its own file

* Go fmt
2021-04-12 14:23:55 +00:00
Nishant Das
c65c6ebc38
Invert BLST Go Tag (#8725)
* invert go tag

* fix rc

* try again

* Revert "try again"

This reverts commit 70ff7658b7cbc43b903bac267f4d7c9833536f8b.

* fix fuzz

* Update shared/bls/blst/BUILD.bazel

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-04-11 11:11:15 +00:00
terence tsao
19a9b4b064
Refactor finality helpers to helpers pkg (#8734)
Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-04-10 16:12:52 +00:00
Victor Farazdagi
1af88b2c35
Remove redundant MerkleRoot function (#8733)
* Remove redundant MerkleRoot function

* update merle_tree() specs comment
2021-04-10 03:13:07 +00:00
ahadda5
e3149c4f0b
Slashing Protection RPC Endpoints for Web Backend (#8723)
* added the removed RPC delete account to accounts.go  and the rpc in proto

* reverted the 3 unit tests namely the failed derived delete, no pub keys provided and the successful imported account with provided public keys; also  brought back the createImportedWalletWithAccounts back in wallet_test.go

* strong password defined elsewhere- removed

* Update validator/rpc/accounts_test.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* added PublicKeys Nil test case

* changed ss to s. ss was a bad name inthe first place

* goimports -w root

* fixed the goimports before running the proto scripts, also changed the deleterequest variable to PublicKeysToDelete

* removed unneeded comment

* added test case for derived, changed delete account to be for both imported and derived

* gofmt

* unrelated files

* unrelated files

* unrelatedfiles restored

* revert unrelated files

* changed the last ss

* adding slashign endpoints

* adding the rpc export and import funcs, still need more testing and add unit tests

* added import slashing unit test

* clean up

* remove less

* Update proto/validator/accounts/v2/web_api.proto

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

* Update proto/validator/accounts/v2/web_api.proto

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

* Update proto/validator/accounts/v2/web_api.proto

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

* Update proto/validator/accounts/v2/web_api.proto

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

* camelCase Proto

* update slashing_protection_json

* update proto

* register in validator/rpc/gateway

* removed the server db creation, the validator cannot begin with a null db

* round trip test

* gofmt

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

* Update validator/rpc/slashing.go

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2021-04-09 19:13:59 +00:00
Victor Farazdagi
0808c02c65
Update spec comments (#8727) 2021-04-08 19:33:54 +00:00
Victor Farazdagi
76390c94af
Refactor ProcessFinalUpdates(), per updated specs (#8724) 2021-04-08 14:20:52 +00:00
Nishant Das
f0e2f561d5
Make BLST The Permanent Default (#8710)
* remove herumi

* gaz

* deprecate flag

* remove source builds of herumi

* remove

* Revert "remove source builds of herumi"

This reverts commit ac7dd133eddcd9ab27d7d75e19efabd994b89d3c.

* disable blst

* remove herumi hard requirement from fuzz

* restrict viz, ensure all deps removed from fuzz

* remove source builds

* add back opts

* add back herumi initialization

* Revert "add back opts"

This reverts commit ad9b409b8ad2410142efba92e71c555fedb2a29e.

* Revert "remove source builds"

This reverts commit b78ee30dba1befad24262648e2fde1583263c87d.

* Revert "restrict viz, ensure all deps removed from fuzz"

This reverts commit 65d951da93103eb327643c3c167ae7498955d244.

* Revert "remove herumi hard requirement from fuzz"

This reverts commit ad92191d8146bf7fea4508fb99a1ae9267683f6d.

* redundant

* add lock for rand generation

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-04-07 10:18:19 -05:00
Victor Farazdagi
74d0134ee3
Weak subjectivity minor refactoring (#8715)
* Add IsWithinWeakSubjectivityPeriod helper method

* Add LatestWeakSubjectivityEpoch method

* ParseWeakSubjectivityInputString helper

* switch to Checkpoint

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-04-06 14:32:49 +00:00