Commit Graph

3363 Commits

Author SHA1 Message Date
terence tsao
7c45c5f8cd
More misc altair changes (#9547)
* More altair changes

* Gazelle
2021-09-08 17:52:37 +00:00
Nishant Das
90038a6001
Implement Network Encoder using SSZ Interface (#9535)
* add stuff

* unused

* kasey's review

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-08 23:16:53 +08: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
terence tsao
d7679d2e71
Validator: rest of the Altair changes (#9532)
* Bring in rest of the validator chagnes

* Go fmt

* Deepsource

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-07 18:43:50 +00:00
Radosław Kapka
ddbac85ec4
Allow returning Altair block headers (#9543)
* GetBlockHeader

* ListBlockHeaders
2021-09-07 18:07:30 +00:00
Nishant Das
ee28dc3d4f
Add in Fork Digest For Subscribers (#9538)
* add in digest

* radek's review

* raul's review

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-07 16:58:24 +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
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
terence tsao
29b851a2b7
RPC: Stream altair block (#9521)
* Add tests

* Fix tests

* Fix test

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-03 19:11:40 +00:00
Nishant Das
cc790ceb2e
Add RPC Changes to Sync For Block Methods (#9497)
* add changes

* radek's review

* kasey's review

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-03 16:00:56 +00:00
Radosław Kapka
e875fe3dfc
Implement ProduceSyncCommitteeContribution in the beacon API (#9524)
* implementation

* test

* change func signature

* remove broadcaster from test
2021-09-03 09:47:35 -05:00
Preston Van Loon
265b5feabf
p2p: Handle nil topic (#9522)
* fix nil topic

* fmt

Co-authored-by: nisdas <nishdas93@gmail.com>
2021-09-03 14:39:54 +08:00
Nishant Das
30b2adc5d6
Add in Sync Contribution And Proof Pubsub Validator (#9475)
* add contribution handlers

* fix it

* fmt

* fix more

* add clean up

* Apply suggestions from code review

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

* Update beacon-chain/sync/validate_sync_contribution_proof.go

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

* use validation pipeline

* deepsource

* fix all tests

* clean up

* comment

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-03 04:06:54 +00:00
terence tsao
924fe20dcd
RPC: list block altair end point (#9494)
* Implement list block altair

* Dont export block container

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 22:21:33 +00:00
Preston Van Loon
2d41f0885c
p2p: Split MsgID into its own file as a public method (#9518)
* p2p: Split MsgID into its own file as a public method

* gofmt

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 21:48:14 +00:00
terence tsao
019f0257c2
RPC: sync committee duties (#9501)
* Add get altair duties

* Refactor, clean up, Rahul's feedback

* Gazelle

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 21:17:42 +00:00
Radosław Kapka
c45fe5cc1c
Implement GetStateV2 in the beacon API (#9506)
* implementation

# Conflicts:
#	beacon-chain/state/v2/BUILD.bazel

* Revert "Auxiliary commit to revert individual files from 2cbe98c88777cac071876fe97f85029fad964e51"

This reverts commit edc4ff52e7796aefd1782e31eaf40231a3134693.

* tests

* fix function call

* make state package visible to migration

* fix span names

Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-02 19:28:55 +00:00
terence tsao
1f48accb0e
RPC: Extend participation and performance to Altair (#9499)
* Add endpoints and tests

* Update beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 18:42:04 +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
Radosław Kapka
4b9fb1cd1b
Add tests to GetBlockV2 (#9486)
* Add tests to `GetBlockV2`

* add missing error assert

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-02 13:08:47 +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
43a24e3d8b
Add Subscription Handler (#9508)
* use subscriber

* fix up tests

* fix

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-02 06:10:02 +00:00
terence tsao
95e07963fb
Stategen: fix state by slot off by 1 (#9509)
* Fix state by slot off by 1

* Comment

* Go fmt

* Add err

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-09-02 03:05:08 +00:00
Raul Jordan
2cd2bc87d0
Sync Committee Message P2P Validations (#9481)
* add in handlers

* add topic switch

* begin refactor

* build

* revert change to sub file

* reordered

* add in handlers

* add topic switch

* fmt

* begin refactor

* build

* revert change to sub file

* reordered

* rationale for cache size

* simplify

* deep source

* kasey feedback

* ignore if not in committee

* add more unit tests

* more cov

* code review commentary

* pass tests

* commentary

* terence comments

* terence feedback on key for cache

Co-authored-by: nisdas <nishdas93@gmail.com>
2021-09-02 02:26:38 +00:00
Radosław Kapka
69ed46af0f
Add RPC validator sync committee code (#9510) 2021-09-01 23:08:05 +00:00
Radosław Kapka
28e472aa5f
Implement PrepareSyncCommitteeSubnets in the beacon API (#9498)
* initial implementation

* final implementation

* review

* fix logic

* refactor duration calculation

* tests

* revert alias change

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-09-01 17:19:29 +00:00
terence tsao
46b22bb649
Clean up committee helpers (#9504)
* Clean up committee related helper funcs

* Go fmt

Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-09-01 15:17:10 +00:00
Nishant Das
44375a3d67
Handle Missing Status Message Better (#9505)
* throw error in status method

* fix up

* fix up

* gaz
2021-09-01 22:25:22 +08:00
Nishant Das
eb690d3737
Add Subscription Topic Handler (#9490)
* add methods

* zahoor's review
2021-09-01 12:07:20 +08:00
Preston Van Loon
dad03ade77
p2p: Return error if no ChainState found for a peer (#9502)
* p2p: Return error if no ChainState found for a peer

* add commentary
2021-08-31 22:25:54 +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
Nishant Das
8d4b92962b
Add in Remaining Altair Core Tests (#9489)
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2021-08-31 07:18:45 +00:00
terence tsao
8f88d574f5
Stategen: replay altair epoch (#9468)
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-30 23:57:08 +00:00
terence tsao
921acc300b
Clean up ProcessInactivityScores (#9483) 2021-08-30 22:50:51 +00:00
terence tsao
516401537a
Update to spec test beta3 (#9491)
* Update to beta3 spec tests

* `ProcessEpochParticipation` processes only active indices

* Go fmt

* Update epoch_precompute_test.go

* Update WORKSPACE

* Fix current and previous epoch switch up
2021-08-30 19:32:11 +00:00
terence tsao
572498f954
Fix deep source complains (#9485) 2021-08-29 20:57:37 +02:00
Raul Jordan
20a1a58860
Proposer Sync Aggregate RPC Methods (#9479)
* sync agg

* more readable

* pass tests

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-28 20:47:45 +00:00
Radosław Kapka
822522a3af
Implement GetSyncCommitteeDuties in the beacon API (#9478)
* implementation

* tests

* review feedback

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-08-28 22:00:46 +02:00
Nishant Das
4d02329cd5
Add in P2P Changes (#9390)
* add in initial changes

* add test method

* raul's review

* Update beacon-chain/p2p/gossip_scoring_params.go

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

* Update beacon-chain/p2p/gossip_scoring_params.go

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

* preston's review

* kasey's review

* only 1

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-08-27 09:34:20 +08: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
terence tsao
1284496648
Increase seen attestation cache sizes (#9476)
* Increase attestation cache sizes

* Update WORKSPACE

* Go fmt

* Fix tests

* Go fmt

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-08-26 21:37:35 +00:00
Radosław Kapka
89941d4be2
Implement GetBlockV2 in the beacon API (#9433)
* Implement `GetBlockV2` in the beacon API

* fix gateway config test

* Revert "fix gateway config test"

This reverts commit 8179400b2ac7cd302c1bca0f191145d017838f5d.

* unregister v2

* review feedback

* improve comment

* reduce duplication

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-08-26 15:22:06 +00: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
Nishant Das
d22552944d
Update Blockchain Package From Altair (#9422)
* add latest changes

* fix up

* raul's review

* pass cache tests

* Update beacon-chain/blockchain/head_sync_committee_info.go

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

* kasey's review

* rename cache err

* add nil checks and error path checks

* gaz

* fix test

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-08-26 05:01:09 +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
terence tsao
ffbb722777
Add active balance cache (#9456)
* Add active balance cache

* Better comment

* Fuzz

* ,

* go fmt

* Fix err

* Raul's feedback

* A few renames to effective
2021-08-25 16:39:12 +00:00
Radosław Kapka
8b10adc92a
Fix struct type used when sending beacon committee subscriptions (#9466) 2021-08-25 15:35:28 +00:00