Commit Graph

4448 Commits

Author SHA1 Message Date
Etan Kissling a08114e996
libp2p light client gossip validation (#3486)
When `--serve-light-client-data` is specified, provides stability on the
`optimistic_light_client_update` GossipSub topic.
2022-03-14 14:05:38 +01:00
tersec f550eb2f17
fix two typos (#3491) 2022-03-14 12:50:23 +00:00
Etan Kissling 29e5a4a752
error and progress codes for light client sync (#3490)
When syncing as a light client, different behaviour is needed to handle
the various ways how errors may occur. The existing logic for blocks can
also be applied to light client objects:
- `Invalid`: Malformed object that is clearly an error by its producer.
- `MissingParent`: More data is needed to decide applicability.
- `UnviableFork`: Object may be valid but will never apply on this fork.
- `Duplicate`: No errors were encountered but the object was not useful.
2022-03-14 10:25:54 +01:00
Ștefan Talpalaru 276762958e
Windows: disable status bar (#3484)
It can randomly lock inside Windows terminal emulators. Better play it
safe.
2022-03-14 10:19:50 +01:00
Dustin Brody 346407ef1c
running Nimbus on Kiln 2022-03-13 19:39:11 +00:00
Mamy Ratsimbazafy 9fd7305e26
Cleanup RPC pubkey handling (#3489) 2022-03-13 08:12:45 +01:00
Etan Kissling 89ac586bd4
serve light client data in CI / dev builds (#3487)
Adjust config for CI / dev builds to serve light client data by default:
`--serve-light-client-data=1 --import-light-client-data=only-new`
2022-03-12 22:12:18 +01:00
dependabot[bot] 280492873f
Bump pillow from 9.0.0 to 9.0.1 in /ncli (#3488)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.0.0 to 9.0.1.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.0.0...9.0.1)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-12 11:02:52 +01:00
Etan Kissling ae408c279a
add option to collect light client data (#3474)
Light clients require full nodes to serve additional data so that they
can stay in sync with the network. This patch adds a new launch option
`--import-light-client-data` to configure what data to make available.
For now, data is only kept in memory; it is not persisted at this time.
Note that data is only locally collected, a separate patch is needed to
actually make it availble over the network. `--serve-light-client-data`
will be used for serving data, but is not functional yet outside tests.
2022-03-11 21:28:10 +01:00
tersec 21b71bd29c
update URL and document Nim bug blocking further genericizing cleanups (#3483) 2022-03-11 15:03:47 +00:00
Jacek Sieka d0183ccd77
Historical state reindex for trusted node sync (#3452)
When performing trusted node sync, historical access is limited to
states after the checkpoint.

Reindexing restores full historical access by replaying historical
blocks against the state and storing snapshots in the database.

The process can be initiated or resumed at any point in time.
2022-03-11 12:49:47 +00:00
Ștefan Talpalaru 857a71be6c
launch_local_testnet.sh: Lighthouse VC nodes (#3477)
* launch_local_testnet.sh: Lighthouse VC nodes
2022-03-11 13:44:56 +01:00
Jacek Sieka 4363215a32
relax `BlockRef` database assumptions (#3472)
* remove `getForkedBlock(BlockRef)` which assumes block data exists but
doesn't support archive/backfilled blocks
* fix REST `/eth/v1/beacon/headers` request not returning
archive/backfilled blocks
* avoid re-encoding in REST block SSZ requests (using `getBlockSSZ`)
2022-03-11 13:08:17 +01:00
Etan Kissling 438aa17f7b
allow `SyncCommitteePeriod` as libp2p params (#3481)
Adds a converter to allow using `SyncCommitteePeriod` as parameter for
libp2p messages (used in pre-release light client sync protocol).
2022-03-11 13:04:08 +01:00
Tanguy f589bf2119
Peer dialing/kicking system overhaul (#3346)
* Force dial + excess peer trimmer
* Ensure we always have outgoing peers
* Add configurable hard-max-peers
2022-03-11 10:51:53 +00:00
Zahary Karadjov 9601735522
Published release notes for v22.3.0 2022-03-10 19:14:56 +02:00
zah 2dd02e54bc
Update the options page in the guide with explanation regarding the format of the config file (#3475) 2022-03-10 17:02:46 +02:00
Zahary Karadjov 023fa3b562
Merge branch 'stable' into unstable 2022-03-10 16:49:18 +02:00
Zahary Karadjov 13b264d509
Final v22.3.0: Add examples for migrating from JSON-RCP to REST 2022-03-10 16:46:11 +02:00
Ștefan Talpalaru 036a851338
Grafana: make local dashboard work with Windows metrics (#3480) 2022-03-09 22:34:35 +01:00
Zahary Karadjov 7b6e36ba6d
v22.3.1 2022-03-09 19:20:01 +02:00
Zahary Karadjov aa3bdb1228
Helpful error message when the user fails to use an array type in TOML
This applies to fields such as `web3-url` which are mapped to array
in TOML in a way that may surprise the user.
2022-03-09 19:11:41 +02:00
Etan Kissling 64242d9c84
add support for `ResourceUnavailable` p2p error (#3476)
The `p2p-interface.md` spec defines a `ResourceUnavailable` error to
return in situations where data that exists on the network is locally
unavailable, e.g., when a block within `MIN_EPOCHS_FOR_BLOCK_REQUESTS`
is requested by `BeaconBlocksByRange` but cannot be provided. This patch
adds support for that additional error code.
2022-03-09 14:03:58 +00:00
Tanguy 266fd98a13
Don't store invalid gossipsub messages (#3471) 2022-03-09 11:30:31 +01:00
Etan Kissling 41c820bc66
`shortLog` for light client types (#3473)
Adds log formatters for light client types.
2022-03-09 11:30:15 +01:00
Etan Kissling 5a3ba5d968
update to pre-release light client sync protocol (#3465)
This adopts the spec sections of the pre-release proposal of the libp2p
based light client sync protocol, and also adds a test runner for the
new accompanying tests. While the release version of the light client
sync protocol contains conflicting definitions, it is currently unused,
and the code specific to the pre-release proposal is marked as such.
See https://github.com/ethereum/consensus-specs/pull/2802
2022-03-08 13:21:56 +01:00
Etan Kissling aaa5a5ad40
add `start_slot` overload for sync periods (#3469)
Adds a `start_slot` overload for `SyncCommitteePeriod` as a shortcut for
`period.start_epoch.start_slot`.
2022-03-08 11:38:58 +01:00
Zahary Karadjov 7340e7cab9
v22.3.0
* Deprecates the JSON-RPC API
2022-03-07 21:49:12 +02:00
Zahary Karadjov 542e645bed
Fix off-by-one error in determining the sync committee when POSTing sync committee messages through the REST API 2022-03-07 21:49:12 +02:00
Zahary Karadjov 5ef2ce4069
Fix #3463 (validator index-out-of-bound errors triggered through the REST API) 2022-03-07 21:49:12 +02:00
Etan Kissling 8955edf158
allow using `BlockId` as key in tables (#3467)
`BlockId` is a type that bundles a block root with its slot number.
The type can be useful as key in tables that deal with non-finalized
blocks (not uniquely identified by slot) and also support pruning
(drop data about older blocks by slot). Instead of creating a custom
type for those use cases, this patch suggests implementing `hash` for
`BlockId` to re-use the existing type.
2022-03-07 14:56:58 +01:00
Etan Kissling 7d7bfa1299
add `toBeaconBlockHeader` overload (#3468)
Overloads `toBeaconBlockHeader` for `ForkedTrustedSignedBeaconBlock`.
2022-03-07 14:56:43 +01:00
TennisBowling 187eabeeb9
Docs fix (#3397)
* geth is bigger

* Update preparation.md

* Update install.md

* Update start-syncing.md

* Update docs/the_nimbus_book/src/start-syncing.md

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>

* Update install.md

* Update docs/the_nimbus_book/src/hardware.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/install.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/install.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/install.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/start-syncing.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/preparation.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

* Update docs/the_nimbus_book/src/preparation.md

Co-authored-by: sacha <sacha.saint-leger@ethereum.org>

Co-authored-by: Jacek Sieka <arnetheduck@gmail.com>
Co-authored-by: sacha <sacha.saint-leger@ethereum.org>
2022-03-06 08:40:17 +01:00
tersec 35f712e378
kiln v2 documentation and testing (#3446) 2022-03-05 16:40:58 +02:00
Ștefan Talpalaru a130ce1eac
Windows: give up stack traces for 40% better performance (#3466)
See: https://github.com/status-im/nimbus-eth2/issues/3453

TODO: make libbacktrace/libunwind work in MSYS2, to get those stack traces back.
2022-03-05 16:40:08 +02:00
Zahary Karadjov 3795d57d30
PKG package for macOS 2022-03-05 15:53:51 +02:00
Zahary Karadjov ec07d3364b
MSI installer for Windows based on the WIX toolkit 2022-03-05 15:53:51 +02:00
Zahary Karadjov e6723ddb24
Allow running Nimbus as a Windows service (--run-as-service) 2022-03-05 15:53:47 +02:00
zah cdeae90806
Add support for TOML config files (--config-file) (#3442) 2022-03-05 04:33:15 +02:00
Ștefan Talpalaru e4b7dbf330
--stop-at-synced-epoch (#3464)
* --stop-at-synced-epoch

This allows benchmarking the initial sync (only forward sync, 1s error
margin). Might be useful in CI, with a timeout, as a sanity check.
2022-03-04 18:38:01 +01:00
Etan Kissling a84ab5d47f
validate `fork_version` as light client (#3459)
The spec does not provide code for validating the `fork_version` field
of `LightClientUpdate`. However, we can use our own logic for additional
validation of that field. The spec's python test suite sets up states
that do not follow the fork schedule (e.g., that use Altair fork version
before Altair fork epoch), which complicates upstreaming this as code.
2022-03-04 17:09:33 +01:00
Mamy Ratsimbazafy ef7e8bdbd2
Minify slashing protection before SQLite (#3393) 2022-03-04 16:43:34 +02:00
zah 8967f9cf01
Work-around the sizeof change in behavior introduced in Nim 1.6 (#3462) 2022-03-04 10:52:49 +02:00
tersec c18cd8ee0c
rename random -> prev_randao in Bellatrix for CL specs v1.1.10 (#3460) 2022-03-03 16:08:14 +00:00
Etan Kissling 47d7814518
update light client to v1.1.10 spec (#3457)
Adopts the changes introduced in the v1.1.10 ETH consensus-specs:
- Introduces `is_finality_update` helper
- Ensures `optimistic_header` always >= `finalized_header`
- Updates spec references
2022-03-03 14:03:08 +01:00
Zahary Karadjov 4c01b77773
The remote Keymanager API was not using the URLs indicated in the spec 2022-03-03 11:10:00 +02:00
Etan Kissling 3ffab01b07
Refactor and optimize sync logs. (#3451)
* Refactor and optimize logs.

* Introduce shortLog(SyncRequest).

* Address review comment.

* make sync queue logs more consistent

Adds a few minor logging improvements:
- Fixes a typo (`was happened` -> `has happened`)
- Avoids passing `reset_slot` argument to log statement multiple times
- Uses same `rewind_to_slot` label when logging in both sync directions
- Consistent rewind point logging

Co-authored-by: cheatfate <eugene.kabanov@status.im>
2022-03-03 09:05:33 +01:00
Etan Kissling 3b20d57277
use next slot when signing for light client tests (#3447)
In practice, the sync committee signs `LightClientUpdate` instances at
the next slot following the block. This is not correctly reflected in
the tests, where it is signed one slot early. This patch updates the
tests to use the correct slot for the computation.
2022-03-02 11:46:17 +01:00
Etan Kissling 33d084192f
consistent style in `light_client_sync.nim` (#3450)
Uses consistent formatting in `light_client_sync.nim`, always refers to
fork-dependent light client objects in full qualified notation, moves
`get_safety_threshold` helper function to same location as in the spec.
2022-03-02 11:44:42 +01:00
tersec f0ada15dac
automated CL spec ref URL updates from v1.1.9 to v1.1.10 (#3455) 2022-03-02 10:00:21 +00:00