19 Commits

Author SHA1 Message Date
Jacek Sieka
867d8f3223
Perform attestation check before broadcast (#2550)
Currently, we have a bit of a convoluted flow where when sending
attestations, we start broadcasting them over gossip then pass them to
the attestation validation to include them in the local attestation pool
- it should be the other way around: we should be checking attestations
_before_ gossipping them - this serves as an additional safety net to
ensure that we don't publish junk - this becomes more important when
publishing attestations from the API.

Also, the REST API was performing its own validation meaning
attestations coming from REST would be validated twice - finally, the
JSON RPC wasn't pre-validating and would happily broadcast invalid
attestations.

* Unified attestation production pipeline with the same flow for gossip,
locally and API-produced attestations: all are now validated and entered
into the pool, then broadcast/republished
* Refactor subnet handling with specific SubnetId alias, streamlining
where subnets are computed, avoiding the need to pass around the number
of active validators
* Move some of the subnet handling code to eth2_network
* Use BitArray throughout for subnet handling
2021-05-10 09:13:36 +02:00
tersec
99fccaee6e
more abstraction over BeaconState (#2509)
* more abstraction over BeaconState

* use HashedBeaconState copy of htr
2021-04-16 08:49:37 +00:00
tersec
050e3ac48b
abstract over more BeaconState usage (#2496) 2021-04-14 11:34:35 +02:00
Dustin Brody
398c151b7d
revert change 2021-04-13 18:50:06 +02:00
Dustin Brody
d6fa4d06bc
abstract over more BeaconState usage 2021-04-13 18:47:44 +02:00
cheatfate
79d4735355 Address #2491. 2021-04-13 17:07:41 +03:00
cheatfate
af1a4d0c05 Simplify validator_id filter's logic. 2021-04-09 21:42:13 +03:00
cheatfate
b3ad573b1f Make error messages to be constants. 2021-04-09 21:42:13 +03:00
cheatfate
c56cb0a485 Fix /api/eth/v1/node/peers arguments handling.
Fix maximum Epoch handling.
2021-04-09 21:42:13 +03:00
cheatfate
5885068c63 Rebase and fixes. 2021-04-09 21:42:13 +03:00
cheatfate
dba69f0ddf Add partial implementation for /api/eth/v1/beacon/headers 2021-04-09 21:42:13 +03:00
cheatfate
7a8e265251 Fix ValidatorIndex issues with workaround. 2021-04-09 21:42:13 +03:00
cheatfate
878d0e7337 Fix validator filtering. 2021-04-09 21:42:13 +03:00
cheatfate
64ddf4490a Add prefixes "Rest" to public tuples. 2021-04-09 21:42:13 +03:00
cheatfate
80e79aef97 Add TODO comments for missing implementations.
Change default REST port to use 5052 (Lighthouse).
Add missing checks for maximum amount of validator ids.
2021-04-09 21:42:13 +03:00
cheatfate
a1303f3e50 Change json serialization framework.
Make all calls which are possible.
2021-04-09 21:42:13 +03:00
cheatfate
b7f36be73c Attempt to find proper readValue. 2021-04-09 21:42:13 +03:00
cheatfate
9de65fa293 Fixing issues after bump. 2021-04-09 21:42:13 +03:00
cheatfate
72695dd62a Rest API initial implementation. 2021-04-09 21:42:13 +03:00