Files
lodestar/docker
dadepo a987fa9aa2 Add doppelganger support (#3883)
* exposing liveness endpoint from beacon node

* Added test for the liveness endpoint

* update description of test

* Correct computing end slot for an epoch

* Added Doppelganger service which polls the beacon nodes liveness endpoint (WIP)

* detect doppelganger based on data from liveness endpoint

* simplify doppelganger registration

* Add doppelganger guide to signing of blocks

* Fix test by only creating an instance - which starts doppelganger proptection - only if it is enabled

* doppelganger added to signing attestation

* filter duties by safe keys

* minor renaming

* make epoch to miss attestation configurable

* a better way to setting default value for doppelgangerEpochsToCheck

* a better way to setting default value for doppelgangerEpochsToCheck also in tests

* Move the doppelganger protection into the validatorStore methods

* Adding a test to confirm validator is shutdown in case of a doppelganger detection

* Added test for when doppelganger is on but no duplicate live keys

* Fix type errors in test after merging master

* Testing that siging block proposer is only allowed after doppelganger period has elapsed

* Testing that attesting is only allowed after doppelganger period has elapsed

* Fix type errros in tests

* Fix lint

* Some renaming, removal of unused code etc

* Improvement to test

* compute timeout used in tests

* increase test timeout

* merged in master and fix conflicts

* minor formating

* Move getLiveness api from lodestar namespace to validator

* Minor style related fixes and reverting unnecessary changes in return statements

* Do not start doppelganger if not after first slot of genesis epoch

* adding proposer to seenBlockProposers on import of block by the beacon node

* de-deuplicate doppelganger options

* fix check-types errors

* do not detect activity of same vc as doppelganger

* Renamed ImportBlockModules variable back to PR. Will rename in another PR

* removing remainingEpochsToCheck and making enableDoppelganger and optional cli option

* fix lint errors

* Including block attesters in the liveness

* Undo renaming

* Return data directly. No need to resolve it in a promise

* fix lint

* fix integration test for the liveness endpoint

* Initial metrics to measure duration of doppelganger check

* Merged in master and fix merge conflicts

* Added doppelganger status to metrics

* Fixing more errors

* making sure generateAttestationData is setting the current slot correctly

* renamed metrics with a vc_ prefix to be inline with naming convention

* having custom bucket instead for vc_doppelganger_check_time_seconds

* Fix lint

* Attempting to expose the vc metrics endpoint also in local metrics setup. Still need to check on server if this works

* Adding epoch as a label to the doppelganger metrics

* Revert "Adding epoch as a label to the doppelganger metrics"

This reverts commit 993a4e81e6.

* Fix logging erros to console to show currentEpoch

* correct path in get liveness endpoint

* should now be observing attesters

* optimise observing block attesters

* fix prunning on finalized

* added some code re-use in tests

* on registering set status as unverified for metrics

* comment to explain the doppelganger status

* Added to metrics when doppelganger detected

* Update packages/lodestar/src/api/impl/validator/index.ts

Co-authored-by: Cayman <caymannava@gmail.com>

* Fix test by updating assertion in test to correspond to changes made to code

* fix lint errors

* Renamed enableDoppelganger => doppelgangerProtectionEnabled

* Fix lint

* fixing compile error after merging in unstable.

* Review PR

* Revert yarn-lock changes

* Review lodesar code

* removing use of uneeded Array.from

* No need to throw. Polutes the log in an expected scenario

* include doppelganger in filter of relevant duties

* Simplify pollLiveness

* Remove unnecessary diff

* Assert doppleganger safe

* Review PR

* replace validator.stop with validator.close since validator.stop has been removed

* Update test to reflect that validator.start has been removed

* Should fix ci: check-types, test, lint and e2e

* Move options to validator

* TODO processed. Removed check introduced in the doppelganger process

* Add doppleganger unit tests

* Validate remoteKeys API data

* Fix spelling

* Log that doppelganger is enabled

* Fetch pubkeys not known yet

* Add createAttesterDuty

* Log to info doppleganger process

* Add processShutdownCallback

* Disable full e2e test in lodestar for doppelganger

* Fix test types

* Use same epoch value in test as another value could be misleading

* Remove doppelgangerStatusMetrics

* Review PR

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: dapplion <35266934+dapplion@users.noreply.github.com>
2022-06-29 20:46:43 +02:00
..