Commit Graph

2906 Commits

Author SHA1 Message Date
terence tsao
229abed848
Test for processAttestations (#8312)
* Add a test for processAttestations

* Log should not contrain could not process attestation...

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-22 18:08:16 +00:00
terence tsao
c5e9b1ec9e
Refactor verifyAttestationIndices method (#8309)
* Refactor verifyAttestationIndices

* Conflict

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-22 17:15:49 +00:00
Radosław Kapka
7842fd9da6
Replace bytes.Equal with assert.DeepEqual in tests (#8318)
* beacon chain

* format imports

* Update beacon-chain/db/kv/migration_archived_index_test.go

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

* Update beacon-chain/db/kv/migration_block_slot_index_test.go

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

* remove unused imports

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

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

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

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

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

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

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

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

* Update beacon-chain/db/kv/migration_archived_index_test.go

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

* Update beacon-chain/db/kv/migration_block_slot_index_test.go

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

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-01-22 15:15:40 +00:00
Nishant Das
50e5b1b4f5
fix deposit index metrics (#8315) 2021-01-22 19:11:02 +08:00
Preston Van Loon
33e266388f
GetDuties: Refactor assignment status to deduplicate status computation (#8313) 2021-01-21 14:22:05 -08:00
terence tsao
2586be29ac
Refactor on_attestation return signature (#8310)
* Update func on_attestation's return signature

* Add return
2021-01-21 18:38:51 +00:00
Radosław Kapka
9cc1438ea9
Peer count node api (#8306)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-21 16:16:56 +00:00
Raul Jordan
241322a7c1
Safe Math for ETH1 Batch Headers Request (#8253)
* batch request underflow checks

* Update beacon-chain/powchain/service.go

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

* return error

* Update beacon-chain/powchain/service.go

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

* test

* Apply suggestions from code review

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

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-21 09:19:44 +00:00
Preston Van Loon
9ec4f727c6
Remove unnecessary state copy (#8303) 2021-01-20 20:00:01 -06:00
terence tsao
ffcadcf184
Rm forkchoice attestation verification (#8301)
* Rm fork choice attestation sig verification

* Unit test

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-20 21:46:13 +00:00
Ivan Martinez
7c59615ae2
Remove go-ssz entirely from prysm (#8257)
* Add DepositSigningData

* gaz

* Add to ssz tests

* Rename to DepositMessage

* Remove deprecated comment

* Remove return

* Fixes from review

* Fixes

* Remove some of gossz

* Remove go-ssz entirely

* Remove unneeded file

* Fix runtime with ssztypes

* Add back ssz files

* Fix formatting

* tidy

* Remove go-ssz from static

* tidy again

* Add tests

* Change to sig

* Fix test

* fx

* Fix visiblity

* Revert "Remove unneeded file"

This reverts commit d66fcda92925133db1a95f8f94ac61bbc6095c69.

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-20 21:03:46 +00:00
Preston Van Loon
d6cccc18c3
verifyDepositDataWithDomain: Use helpers.ComputeSigningRoot (#8302) 2021-01-20 20:30:58 +00:00
terence tsao
befe8d88b8
Remove duplicated target root check for fork choice attestation (#8277)
* Rm redundant target root check for fork choice attestation

* Comments

* Revert back verifyBeaconBlock

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-20 18:27:10 +00:00
Radosław Kapka
153737803a
Implement ListPeers in the node API (#8288)
* add span

* update ethereumapis

* align server with ethereumapis

* benchmark

* naive implementation

* rename two status functions

* new Inbound and Outbound status functions

* tests

* 'enr:' prefix

* refactoring

* gzl

* case when one filter is empty

* empty filter condition fix

* deepsource

* rename getPeer to peerInfo

* bring back correct version of ethereumapis

* go mod tidy
2021-01-20 15:52:33 +00:00
terence tsao
578dabe27c
Remove duplicated LMD FFG check for fork choice attestation (#8276)
* Rm redundant lmd<->ffg check for fork choice attestation

* Comments

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>
2021-01-20 10:19:43 +00:00
terence tsao
5d841874f7
Return error on AttestingIndices bitfield length check (#8285)
* Return error on committee len check

* AttestingIndices unit test

* Add equality check

* Fixing more tests

* Fix rest of the tests

* Fix invalid bit length test

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-20 03:00:52 +00:00
terence tsao
084e5bd020
Add test TestStore_OnAttestation_Ok (#8293)
* Add test TestStore_OnAttestation_Ok

* Handle errors

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-19 23:10:10 +00:00
terence tsao
bc2c206832
Add verify slot target epoch function and apply all (#8273)
* Add verify slot target epoch function and apply all

* Fix TestProcessAttestationsNoVerify_IncorrectSlotTargetEpoch

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-19 21:41:44 +00:00
Radosław Kapka
f89fd67952
Better receiver names in beacon chain module (#8286) 2021-01-19 13:21:32 +00:00
Nishant Das
20b836d038
Add Initial Support For Gossip Scoring Service (#8275)
* checkpoint progress

* gaz

* fix

* add it in

* Update beacon-chain/p2p/pubsub.go

* fmt

* reformat imports

Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-01-19 12:13:08 +00:00
pinglamb
09a792ded4
isCanonical for slot 0 should return true (#8269)
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-01-16 16:14:14 +00:00
terence tsao
cf343be76a
Add a helper to validate nil attestation (#8272)
* Add verify nil attestation function and apply all

* Remove invalid attestatione debug log

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-15 22:19:17 +00:00
pinglamb
d7d2c6354b
Blocks filtering should return genesis when startSlot=0 and endSlot=0 (#8270)
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-01-15 18:36:17 +00:00
terence tsao
b6c4bc197f
Add on_block finality test (#8266)
* Can generate at epoch boundary

* Remove extra space

* Add on block finality test

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-15 13:42:49 +00:00
Nishant Das
ce397ce797
Prune Excess Peers Better (#8260)
* add method

* add changes

* formatting

* choose

* fix waitgroup

* add

* add debug logs

* gaz

* make it better

* fix

* godoc

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-14 21:28:20 +00:00
Radosław Kapka
2d75b12791
Implement GetIdentity in the node API (#8230)
* initial implementation

* register metadata provider

* final implementation

* tests

* fixed imports

* gazelle

* code review

* small cleanup

* change errors.Wrap to status.Errorf

* gazelle + goimports

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-14 20:48:40 +00:00
Radosław Kapka
a2d4e3302c
Implement GetPeer in the node API (#8264)
* tests

* capitalize error message
2021-01-14 10:26:16 -06:00
terence tsao
daf6da5beb
Add hydrate indexed att test helper (#8261)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-13 22:05:57 +00:00
pinglamb
9369bb6781
Copied over ssz.DeepEqual as sszutil.DeepEqual from go-ssz (#8258)
* Copied over ssz.DeepEqual as sszutil.DeepEqual from go-ssz

* Added test cases for DeepEqual

* Remove commented code
2021-01-13 20:40:56 +00:00
terence tsao
eeda9f18fe
Disallow duties request where req.Epoch > current.Epoch+1 (#8252)
* Disallow request epoch to be out of bound

* Input Slot and epoch checks

* Tests

* Review feedbacks

* Unavailable error code

* Rename genesis time fetcher to time fetcher

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-12 23:27:37 +00:00
pinglamb
1a9207ba46
Removed some simple go-ssz usage (#8250)
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-01-12 19:31:34 +00:00
pinglamb
9f423617cb
Added db.BlocksBySlot and db.BlockRootsBySlot (#8184)
* Added blockBySlot and blockRootBySlot

* Changed to BlocksBySlot and BlockRootsBySlot

* Updated to use BlocksBySlot and BlockRootsBySlot

* Added missing passthrough to karfa exporter

* Return hasBlocks/hasBlockRoots in the new getters

* Fixed CI lint

* Replace call to bytes.Compare with bytes.Equal

* Reordered the returns of the new getters

Co-authored-by: Nishant Das <nishdas93@gmail.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-12 18:31:15 +00:00
Radosław Kapka
015102c2d5
Implement GetSyncStatus in the node API (#8241)
* Implement GetSyncStatus in the node API

* gazelle

* add HeadSlot function to fuzz tests' fakeChecker

* use HeadFetcher to get head slot

* remove useless code

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-12 17:17:20 +00:00
Radosław Kapka
5dda2ca328
Replace HTTP code with gRPC code in GetHealth API endpoint (#8249)
* Replace HTTP code with gRPC code in GetHealth API endpoint

* gazelle

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-12 16:20:20 +00:00
Ivan Martinez
e5556db49d
Add DepositMessage in preparation to remove go-ssz (#8244)
* Add DepositSigningData

* gaz

* Add to ssz tests

* Rename to DepositMessage

* Remove deprecated comment

* Remove return

* Fixes from review

* Fixes

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-12 00:45:11 +00:00
Raul Jordan
d97596348e
Add Back New Attester Protection DB Logic (#8242)
* Revert "Revert New Attester Protection DB Logic (#8237)"

This reverts commit 6738fa3493.

* Batch Attestation Records and Flush All at Once in Validator DB (#8243)

* begin flushing logic

* finalize logic before starting tests

* make code DRY

* better log fields

* gaz

* tweak parameter

* rename

* clarifying comment on error handling in event feed

* comprehensive tests

* more comments

* explain parameters in comments

* renamed consts

* Apply suggestions from code review

* gaz

* simplify

* typo

* comments
2021-01-11 23:59:17 +00:00
Radosław Kapka
5fd03f8fb0
Unify the pattern of using a package-level logger (#8245)
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
2021-01-11 20:03:28 +00:00
terence tsao
18bb86754a
Hydrate signed block helper (#8246)
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2021-01-11 19:27:30 +00:00
terence tsao
9a1866b735
Hydrate header test helper (#8234)
* Hydrate headers and fix tests

* Gazelle

* Fix a slashing test

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2021-01-09 16:45:45 +00:00
Raul Jordan
6738fa3493
Revert New Attester Protection DB Logic (#8237)
* Revert "Optimize Migration for new Attester Protection DB (#8231)"

This reverts commit c4ab67832f.

* Revert "Integrate New Slashing Protection DB Methods at Runtime (#8219)"

This reverts commit 3858068201.

* Revert "DB Migration for Optimal Local Slashing Protection (#8212)"

This reverts commit dd3ac6c2ed.
2021-01-09 04:00:56 +00:00
Nishant Das
0ff2a53b2f
Add Peer Logger (#8226)
Co-authored-by: Victor Farazdagi <simple.square@gmail.com>
2021-01-08 11:08:11 +00:00
Raul Jordan
3858068201
Integrate New Slashing Protection DB Methods at Runtime (#8219)
* integrate at runtime and revamp tests

* historical att

* Update validator/db/iface/interface.go

* deepsource

* import

* log the slashing kind

* gaz

* create a slashutils

* integrate new slashutil

* imports
2021-01-07 23:30:25 +00:00
terence tsao
bc650c82b4
Hydrate attestation for tests (#8228) 2021-01-07 21:00:21 +00:00
terence tsao
9ff825a570
Update variable names that are same as imports (#8220)
* Fix names that are same as import name

* Review feedbacks
2021-01-07 10:42:03 -06:00
Radosław Kapka
353c1f6387
Multiple discovery addresses (#8203)
* multiple discovery addresses

* ipv6 fix

* make len test more robust

* create enr node for testing

* use local node for test

* use mockListener

* remove unused type alias
2021-01-07 13:35:42 +00:00
pinglamb
9135774720
Block Fetching with Graceful Retry (#8182)
* Added tooMuchDataRequestedError func

* Added multiplicative decrease and additive increase

* Code review changes

* Renaming the new constants

* Return a different error in graceful retry

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Nishant Das <nishdas93@gmail.com>
2021-01-07 06:21:44 +00:00
Potuz
e52c3d48cf
Start from last valid root in loadStateBySlot (#8218)
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2021-01-06 18:41:44 -06:00
Radosław Kapka
9b3e1eb643
Implement GetHealth in the node API (#8217)
* Implement GetHealth in the node API

* repair fuzz mock

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
2021-01-06 20:11:20 +00:00
Radosław Kapka
392e61fbee
Revert changes to sync service status check (#8215) 2021-01-06 11:19:53 +00:00
Radosław Kapka
7135a8542f
Check if initial sync service has been initialized (#8214) 2021-01-06 10:45:22 +00:00