Commit Graph

1875 Commits

Author SHA1 Message Date
Zahary Karadjov 8cd570fc52
Merge branch 'stable' into unstable 2021-04-20 18:17:54 +03:00
Zahary Karadjov 2faaf391a0
v1.2.1 2021-04-20 16:55:37 +03:00
Jacek Sieka 54d6884c89
fix sync issue when upgrading from 1.1.0-inited db
This patch writes a full genesis state to `kvstore` if one was missing,
which fixes 1.2.0 restarting sync when upgrading from 1.1.0, or when
downgrading to a pre-1.1.0 release.
2021-04-20 16:55:18 +03:00
Zahary Karadjov 9b57535f33
Merge branch 'stable' into unstable 2021-04-19 19:55:20 +03:00
Zahary Karadjov e1a8049ed5
v1.2.0 2021-04-19 19:54:24 +03:00
Ștefan Talpalaru 5b32f7ca17 Nim-1.2.12 2021-04-19 10:53:58 +03:00
Jacek Sieka daf98e4330 fix committee vs subnet confusion 2021-04-18 14:17:45 +03: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
Ștefan Talpalaru 85acf55ad8
remove duplicate metric (#2507) 2021-04-15 13:42:40 +02:00
Jacek Sieka f1f424cc2d attestation processing speedups
* avoid creating indexed attestation just to check signatures - above
all, don't create it when not checking signatures ;)
* avoid pointer op when adding attestation to pool
* better iterator for yielding attestations
* add metric / log for attestation packing time
2021-04-14 21:51:17 +03:00
Zahary Karadjov b0912b8eaf
Remove some unused parameters 2021-04-14 16:15:22 +03:00
tersec 050e3ac48b
abstract over more BeaconState usage (#2496) 2021-04-14 11:34:35 +02:00
Dmitriy Ryajov 3e3137ec14 pass max peers to builder 2021-04-14 10:15:29 +03:00
Jacek Sieka 4ed2e34a9e Revamp attestation pool
This is a revamp of the attestation pool that cleans up several aspects
of attestation processing as the network grows larger and block space
becomes more precious.

The aim is to better exploit the divide between attestation subnets and
aggregations by keeping the two kinds separate until it's time to either
produce a block or aggregate. This means we're no longer eagerly
combining single-vote attestations, but rather wait until the last
moment, and then try to add singles to all aggregates, including those
coming from the network.

Importantly, the branch improves on poor aggregate quality and poor
attestation packing in cases where block space is running out.

A basic greed scoring mechanism is used to select attestations for
blocks - attestations are added based on how much many new votes they
bring to the table.

* Collect single-vote attestations separately and store these until it's
time to make aggregates
* Create aggregates based on single-vote attestations
* Select _best_ aggregate rather than _first_ aggregate when on
aggregation duty
* Top up all aggregates with singles when it's time make the attestation
cut, thus improving the chances of grabbing the best aggregates out
there
* Improve aggregation test coverage
* Improve bitseq operations
* Simplify aggregate signature creation
* Make attestation cache temporary instead of storing it in attestation
pool - most of the time, blocks are not being produced, no need to keep
the data around
* Remove redundant aggregate storage that was used only for RPC
* Use tables to avoid some linear seeks when looking up attestation data
* Fix long cleanup on large slot jumps
* Avoid some pointers
* Speed up iterating all attestations for a slot (fixes #2490)
2021-04-13 20:24:02 +03: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 c2c3fdb471 Simplification and compiler error fix. 2021-04-13 17:07:41 +03:00
cheatfate fc5ca8ec35 Address #2487 and #2488. 2021-04-13 17:07:41 +03:00
cheatfate 79d4735355 Address #2491. 2021-04-13 17:07:41 +03:00
cheatfate b0a3008a1b Address #2486. 2021-04-13 17:07:41 +03:00
cheatfate 3417871370 Address #2489. 2021-04-13 17:07:41 +03:00
cheatfate 477decbcf5 Address #2490. 2021-04-13 17:07:41 +03:00
tersec 498c998552
abstract over most withStateVars/withState state var usage (#2484)
* abstract over most withStateVars/withState state var usage

* cleanups
2021-04-13 15:05:44 +02:00
Dmitriy Ryajov 1d6518eaaa use `new` instad of `init` 2021-04-12 20:28:39 +03:00
Dmitriy Ryajov 920de91c37 use libp2p builder 2021-04-12 20:28:39 +03:00
cheatfate 9cd946a192 Proper fix for ValidatorIndex supported values. 2021-04-09 21:42:13 +03:00
cheatfate af1a4d0c05 Simplify validator_id filter's logic. 2021-04-09 21:42:13 +03:00
cheatfate 5268d03b68 Finish error message to constants process. 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 934cc453d9 Add "BETA version" note to the `--rest` server command line parameters descriptions. 2021-04-09 21:42:13 +03:00
cheatfate d443801818 Fix /api/eth/v1/validator/duties/attester/{epoch} request body ValidatorIndex issues. 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 23b2e663f1 Fix /api/eth/v1/node/peers response. 2021-04-09 21:42:13 +03:00
cheatfate 55cbb82ab5 Fix /api/eth/v1/node/peer_count response. 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 a6147f7b9d Fix `/eth/v1/config/fork_schedule` path. 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 2cf0d3d831 Simplification of POST/api/nimbus/v1/graffiti and GET/api/nimbus/v1/graffiti call implementation. 2021-04-09 21:42:13 +03:00
Zahary Karadjov 5266db3485 Add a POST /api/nimbus/v1/graffiti API 2021-04-09 21:42:13 +03:00
cheatfate ec48e30ea8 Fix fork/schedule procedure comment. 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
cheatfate c4d891f583 Fix sync_manager.nim to return proper status.
Bump REST API dependencies.
2021-04-09 21:42:13 +03:00
tersec 79bb0d5379
only deserialize attestation and aggregation gossiped signatures once (#2472)
* only deserialize attestation and aggregation gossiped signatures once

* re-indent some aggregate checks into block scope

* spelling

* remove debugging assertion

* put part of gossip validation back into block context

* attestation pool test signature loading isn't so unsafe, and exportRaw isn't free

* remove more development doAsserts; don't exportRaw in loops
2021-04-09 14:59:24 +02:00