Commit Graph

1290 Commits

Author SHA1 Message Date
Radosław Kapka
cb9c1ad0fe
Implement Semi-Generic GetBeaconBlock RPC Endpoint for Pre & Post-Fork Blocks (#9517)
* BuildBlockData

* GetBlockAlatair

* build file

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer_test.go

* review comments

* add alias

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go

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

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go

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

* add get block test

* comment

* implement get beacon block

* commentary

* test setup issues

* Use correct genesis state

* test renames

* pass

* rem commented code

* ctx unused

* proper grpc errors

* Update beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2021-09-09 05:26:49 +00:00
Preston Van Loon
b586d3784b
Rename beacon-chain/core/state to beacon-chain/core/transition pkg (#9530)
* Move, refactor, fix

* @rkapka PR feedback: revert irrelevant changes

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-08 10:41:47 +00:00
Raul Jordan
d210dd7691
Maintainable Beacon Block API Endpoints (#9528)
* add new proto endpoints and deprecate old

* regen protos

* regen mocks

* begin fixing tests

* build tests

* e2e build

* go build

* resolve conflicts

* pass tests

* amend generated name

* fix build

* more fixes

* update gateway paths

* radek comments

* fix comment

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-09-07 15:17:50 +00:00
Radosław Kapka
d6416b29b2
Set Content-Length to zero for empty POST reponse (#9540)
* Set `Content-Length` to zero for empty POST reponse

* remove unused function param
2021-09-07 08:54:44 -05:00
Preston Van Loon
dc71f35f4f
Remove copyutil pkg, move v1alpha1 copy methods into v1alpha1 pkg (#9533) 2021-09-04 06:55:57 +00:00
Preston Van Loon
4beb352e6f
Move Slot and Epoch functions from helpers to core pkg (#9519)
* Move Slot and Epoch functions from helpers to core

* limited viz

* goimports

* fix fuzz build

* fix fuzz build

* fix

* fix

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-03 20:10:31 +00:00
Kirill Fedoseev
f319535af5
Fix countdown timer (#9484)
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-02 20:41:01 +00:00
terence tsao
b10964514a
Implement SubmitPoolSyncCommitteeSignatures in the beacon API (#9464) (#9503)
* Implement `SubmitPoolSyncCommitteeSignatures` in the beacon API (#9464)

* Update server

* remove duplicated field

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2021-09-02 16:54:53 +00:00
Marcin Górzyński
02966e64d8
Feature lru cache wrapper 2 (#9511)
* Add Wrapper to LRU Cache to handle Invalid Parameters #9461

* Regenerate BUILD.bazel and simplify tests using lru.Cache

* Fix: fuzz_exports.go build error

* Fix: block_fuzz.go

* Revert lru.Cache interface

* Remove redundant err check in pending_attestations_queue_test.go

* Add tests for lru wrapper

* Use lru package in prysm/shared instead of lruwrpr

* Fix: goimports

* Fix: BUILD.bazel

Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-09-02 18:36:54 +08:00
Nishant Das
59ed552c64
Buffer Errors For Resubscribers (#9513)
* fix blocker

* make test better

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 03:33:25 +00:00
Nishant Das
0ea4e9a71c
fix trie (#9495) 2021-08-31 08:01:26 -07:00
terence tsao
da5f37fc71
Clean up from hf1 (#9493)
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-08-31 10:47:44 +00:00
Raul Jordan
031830baa4
Remove Kafka from Prysm (#9470)
* remove kafka

* gaz

* rem foreign rules

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-26 23:59:00 +00:00
Raul Jordan
c1f841d6d4
Allow Sending Interfaces Over Application Event Feeds (#9458)
* add event feed changes

* deep source issues

* omit receiver name

Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-08-26 15:21:29 -05:00
Raul Jordan
7d5f30b01e
Delete Deprecated Flags and Old Slashing Protection for V2 (#9453)
* delete deprecated flags and old slashing protection schema

* remove toledo mentions

* build

* do not remove migration
2021-08-26 13:48:25 -05:00
terence tsao
74df479bd3
Use active balance cache (#9469)
* Use active balance cache

* Feature flag and test

* Gazelle

* Fix fuzz

* Fix test

* Mix in validator count

* Update test to reflect validator count

* Add eth1 data block hash

* Fix assign

* Use eth1 data root

* Update active_balance_test.go

* Remove eth1 data root

* Remove eth1 data usage in tests

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-08-26 14:32:40 +00:00
terence tsao
2903275e7e
Altair process slots (#9455)
* Update process slots

* More test scenarios

* Update transition_test.go

* Add CanUpgradeToAltair

* Go fmt

* Gaze

* Update beacon-chain/core/state/transition.go

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

* Update transition_test.go

* Update altair fork epoch for e2e

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-26 09:59:23 +08:00
Preston Van Loon
3d6fad3121
Update Prater config to include Altair fork epoch (#9467)
* Update Prater config after https://github.com/eth2-clients/eth2-networks/pull/58. Add tests to enforce compliance.

* gofmt

* spec: true

* fix test

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-25 17:18:29 +00:00
Raul Jordan
e150e29710
Add In Generated Mocks for Altair RPC (#9457) 2021-08-24 21:38:44 +00:00
terence tsao
5c96a2713d
Prevent Reinsertion of Orphaned Attestations Into Pool (#9442)
* Can re-save orphaned attestation

* Go fmt

* Fix tests

* Go fmt

* Bug fix flag

* Bug fix flag

* Go fmt

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-24 03:05:08 +00:00
terence tsao
d3475a563d
Remove Canonical Attestations From Pool Correctly (#9444)
* Remove canonical attestaitons

* Rm debug log

* Remove deleted test

* Tests and fmt

* Tests

* Bug fix flag

* Move feature flag

* Go fmt

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-24 00:33:17 +00:00
Preston Van Loon
5442d0f486
Altair: Merge passing hf1 tests and shared code (#9447)
* Altair: Merge passing hf1 tests and shared code

* Remove weird files

* del commented code

* Add dynamic file fetching, remove hardcoded list of files

* Remove hard coded paths

* remove hardcoded paths from phase0 too

* nosec fixes
2021-08-23 20:09:24 +00:00
Raul Jordan
0ee203fc2e
Deduplicate Copy Functions In State Packages (#9437)
* remove duplicated copy functions

* add all unit tests

Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-08-23 16:53:50 +00:00
Raul Jordan
bdfdba1e23
Remove Unused Trieutil Helpers (#9435)
* remove unused trieutil helpers

* gaz

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-20 23:00:04 +00:00
Raul Jordan
eac542a8ac
Change Eth2 Repository Names (#9425)
* eth2 repo name changes

* rem sha

* use consensus spec terminology and pin sha
2021-08-19 13:00:57 -05:00
Raul Jordan
72cfe50eff
Move Validator Accounts Protos Into Proper Place (#9416)
* move into proper namespace

* package naming

* add strict deps

* regen protos

* add web api

* regen

* builds

* rename

* build
2021-08-18 21:24:01 +00:00
Preston Van Loon
4966300c96
Update spectests to v1.1.0-beta.1 from hf1 branch (#9403)
* Update spectests to v1.1.0-beta.1 from hf1 branch

* fix params loading
2021-08-17 21:23:38 +00:00
terence tsao
b28d65dc34
Add pyrmont hard fork config (#9394)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-16 19:51:43 +00:00
Raul Jordan
8122da6c97
Add Gosec Github Action (#9332)
* add gosec security scan

* add gosec ignores first batch

* more nosec for exec

* add filepath clean

* more nosec

* file inclusion nosec

* build

* herumi

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-15 15:24:13 +00:00
Radosław Kapka
f516e71167
Move proto services to a different package (#9379)
* Move proto services to a different package

# Conflicts:
#	beacon-chain/rpc/service.go

* fix tests

* goimports

* fix java class name
2021-08-13 10:55:24 +00:00
Nishant Das
a9f2170657
Update P2PUtils And Parameters From Altair (#9373)
* add changes

* add p2putils changes

* clean up

* fix build

* remove test

* raul's review
2021-08-13 13:11:11 +08:00
terence tsao
d77616f705
Fixes Issues Found by Goland IDE Code Inspect (#9368)
* Ran code inspect

* Update shared/testutil/altair.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-11 20:12:22 +00:00
terence tsao
9668ab0fea
Clean up duplicated imports (#9354) 2021-08-10 14:55:24 -05:00
Preston Van Loon
bfdaf8a3f5
Fix config loader tests (#9348)
* don't mutate mainnet config

* add missing minimal config params

* Ensure all yaml fields were set and are correct

* gofmt

* Add sanity check that some empty yaml wasn't given

* Gazelle and deepsource feedback
2021-08-09 18:40:06 +00:00
terence tsao
38787353a2
Attestation: get participation status (#9340)
* Add participation flag indics matching helpers

* Gazelle

* Tests

* Update BUILD.bazel

* Update attestation.go
2021-08-09 16:35:46 +00:00
Radosław Kapka
57fac9b74f
Improve API Middleware design (#9324)
* remove superfluous WriteHeader call

* move custom handlers outside hooks

* rename OnPostStart hook

* function that returns a default endpoint

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-05 20:21:43 +00:00
Radosław Kapka
c5b68b4f03
Implement PublishAggregateAndProofs in the validator API (#9294)
* grpc implementation

* build file

* full implementation

* remove unused function

* tests

* wrap top-level array

* Update beacon-chain/rpc/eth/v1/validator/validator.go

Co-authored-by: terence tsao <terence@prysmaticlabs.com>

* review

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-08-04 09:01:38 +00:00
Mohamed Mansour
47c28e6cd6
Show error in logs if passing invalid flags in yaml (#9033)
* Show error in logs if passing invalid flags in yaml

The YAML configs pass if an invalid flag is set, this causes frustration
because the flag could have been mispelled causing a huge mystery.

This will strictly check if the flags are deserialized, if a flag
doesn't exist, it will error out as a Fatal error with appropriate
reasoning which flag is wrong.

* Fix review comments to make some of them non-fatal

* Make yaml.TypeError a pointer

* Remove UnmarshalStrict from spectests since they use a different YAML package

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-08-01 03:26:24 +00:00
terence tsao
012d279663
Fix duplicated imports (#9304)
* Fix duplicated imports

* Fix metrics test
2021-07-29 16:45:17 -05:00
Radosław Kapka
4db0dfc4f1
Properly broadcast attestations (#9301)
* better handling of gateway response

* empty response tests

* build file

* broadcast attestations properly

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-07-29 18:33:18 +02:00
Raul Jordan
9145310647
Eliminate Proto V2 Namespace (#9297)
* get rid of v2 in prysm codebase

* replace block2

* builds

* terence comments

* gazelle
2021-07-28 21:23:44 +00:00
Raul Jordan
98f7f82b2f
Copy Altair Changes Into v1alpha1 Namespace (#9296)
* move the v2 changes into v1alpha1

* v1alpha1 builds

* regenerate pbs

* regenerate ssz

* top level builds
2021-07-28 18:05:07 +00:00
terence tsao
f16b9859e7
Test: add altair test utility (#9287)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-07-28 17:15:23 +00:00
Nishant Das
a372e30c8f
Fix Spaced Arguments for Subcommands (#9292)
* fix args for commands

* fix nasty edge case
2021-07-28 14:36:48 +00:00
Nishant Das
415973fca3
remove flag (#9290) 2021-07-28 16:11:22 +08:00
Mohamed Zahoor
c6bd7a2f83
Efficient Historical State Representation (#9155)
* added migration in to new schema

* gazel fix

* goimports fix

* construct state with validator entries from a seperate bucket

* save state with validator entry indirection

* fixed save and retreieve issues

* fixed more test cases related to DeepEqual

* added save benchmark

* gazel fix

* organize benchmarks

* add cache and improve state construction  performance

* gazel fix

* check type

* remove cache checking from Has

* fix decoding when cache is off

* fix slice bugs

* add migration testcases

* linter fix

* fix few review comments

* fix review feedback

* gazel fix

* satisfy deepsource

* added the feature flag

* lint fix

* fix usage of featureconfig Inti in testcases

* call resetConfig method

* add feature flag in  migration testcases

* fix formatting

* change bucket name from blockRootValidatorKeysIndexBucket to blockRootValidatorHashesBucket

* remove from cache when state deleted

* fixed few more comments

* added to devModeFlags

* added cache delete under the feature flag

* fix lint

* change cache sizes and improve documentation

* fiexed few more review coments

* not using hash anymore and using a new SaveStates function

* satisfu deepsource

* run gazel

* fix feature flag related stuff

* fixing merge conflict fix

* few goodies

* improve UX and dont swallow error

* merge fix

* import format fix

* fix migrationion when flag not given issue

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-07-27 20:02:53 +00:00
Raul Jordan
1ea1c69174
Copy V1Alpha1 Protos and API Endpoints To V2 Namespace (#9284)
* v2 builds

* generate go code

* fix build
2021-07-27 16:54:49 +00:00
Radosław Kapka
8c8f1bb9c1
Regression test for #9264 (#9277) 2021-07-26 11:48:51 +00:00
terence tsao
8db0c9a0e6
Move proto/interfaces -> proto/prysm/v2 (#9270)
* Move proto/interfaces -> proto/prysm

* Update paths

* Fix block2

* Update blocks_fetcher_utils.go

* Update BUILD.bazel

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-07-23 20:10:15 +00:00
Radosław Kapka
be82c8714f
Do not require a handler function in the gateway (#9264)
* Do not require a handler function in the gateway

* test fix

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-07-23 16:48:22 +00:00