Ethereum consensus client in Rust
Go to file
Michael Sproul 54cf94ea59 Fix per-slot timer in presence of clock changes (#3243)
## Issue Addressed

Fixes a timing issue that results in spurious fork choice notifier failures:

```
WARN Error signalling fork choice waiter     slot: 3962270, error: ForkChoiceSignalOutOfOrder { current: Slot(3962271), latest: Slot(3962270) }, service: beacon
```

There’s a fork choice run that is scheduled to run at the start of every slot by the `timer`, which creates a 12s interval timer when the beacon node starts up. The problem is that if there’s a bit of clock drift that gets corrected via NTP (or a leap second for that matter) then these 12s intervals will cease to line up with the start of the slot. This then creates the mismatch in slot number that we see above.

Lighthouse also runs fork choice 500ms before the slot begins, and these runs are what is conflicting with the start-of-slot runs. This means that the warning in current versions of Lighthouse is mostly cosmetic because fork choice is up to date with all but the most recent 500ms of attestations (which usually isn’t many).

## Proposed Changes

Fix the per-slot timer so that it continually re-calculates the duration to the start of the next slot and waits for that.

A side-effect of this change is that we may skip slots if the per-slot task takes >12s to run, but I think this is an unlikely scenario and an acceptable compromise.
2022-06-06 23:52:32 +00:00
.github Fix Rust 1.61 clippy lints (#3192) 2022-05-20 05:02:13 +00:00
account_manager Improve slashing import log (#3122) 2022-03-28 07:14:16 +00:00
beacon_node Fix per-slot timer in presence of clock changes (#3243) 2022-06-06 23:52:32 +00:00
book Fix links in docs (#3219) 2022-05-31 06:09:07 +00:00
boot_node v2.3.0 (#3222) 2022-05-30 01:35:10 +00:00
common Update Ropsten TTD (#3240) 2022-06-04 21:24:39 +00:00
consensus Inline safe_arith methods (#3229) 2022-05-31 06:09:12 +00:00
crypto Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
database_manager Conserve disk space by raising default SPRP (#3137) 2022-04-01 07:16:25 +00:00
lcli Use a stable tag for ubuntu in dockerfile (#3231) 2022-05-31 06:09:12 +00:00
lighthouse Improve eth1 block cache sync (for Ropsten) (#3234) 2022-06-03 06:05:03 +00:00
scripts Updates to tests and local testnet for Ganache 7 (#3056) 2022-03-20 22:48:14 +00:00
slasher Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
testing Switch Nethermind integration tests to use master branch (#3228) 2022-06-03 03:22:55 +00:00
validator_client Add new VC metrics for beacon node availability (#3193) 2022-05-26 02:05:16 +00:00
.dockerignore Exclude EE build dirs from Docker context (#3174) 2022-05-09 23:43:31 +00:00
.editorconfig Add editorconfig template 2019-03-11 15:09:57 +11:00
.gitignore Delete uncompressed genesis states (#2092) 2020-12-16 03:44:05 +00:00
.gitmodules Replace EF tests submodule with a makefile 2019-09-08 04:19:54 +10:00
bors.toml Add minimum supported Rust version (#3082) 2022-03-17 03:33:29 +00:00
Cargo.lock v2.3.0 (#3222) 2022-05-30 01:35:10 +00:00
Cargo.toml Update and consolidate dependencies (#3136) 2022-04-04 00:26:16 +00:00
CONTRIBUTING.md Update CONTRIBUTING.md (#751) 2020-01-03 10:45:53 +11:00
Cross.toml Optimise slasher DB layout and switch to MDBX (#2776) 2021-12-21 08:23:17 +00:00
Dockerfile Use a stable tag for ubuntu in dockerfile (#3231) 2022-05-31 06:09:12 +00:00
Dockerfile.cross Use a stable tag for ubuntu in dockerfile (#3231) 2022-05-31 06:09:12 +00:00
LICENSE Update License to Apache 2.0 2019-04-15 16:47:35 +10:00
Makefile cargo audit updates (#3063) 2022-03-08 19:48:12 +00:00
README.md Remove build status badge from README (#3195) 2022-05-20 05:02:14 +00:00
SECURITY.md Add how users should report security vulnerabilities for this repository (#2562) 2021-09-07 01:54:05 +00:00

Lighthouse: Ethereum consensus client

An open-source Ethereum consensus client, written in Rust and maintained by Sigma Prime.

Book Status Chat Badge

Documentation

Banner

Overview

Lighthouse is:

  • Ready for use on Ethereum consensus mainnet.
  • Fully open-source, licensed under Apache 2.0.
  • Security-focused. Fuzzing techniques have been continuously applied and several external security reviews have been performed.
  • Built in Rust, a modern language providing unique safety guarantees and excellent performance (comparable to C++).
  • Funded by various organisations, including Sigma Prime, the Ethereum Foundation, ConsenSys, the Decentralization Foundation and private individuals.
  • Actively involved in the specification and security analysis of the Ethereum proof-of-stake consensus specification.

Staking Deposit Contract

The Lighthouse team acknowledges 0x00000000219ab540356cBB839Cbe05303d7705Fa as the canonical staking deposit contract address.

Documentation

The Lighthouse Book contains information for users and developers.

The Lighthouse team maintains a blog at lighthouse-blog.sigmaprime.io which contains periodical progress updates, roadmap insights and interesting findings.

Branches

Lighthouse maintains two permanent branches:

  • stable: Always points to the latest stable release.
    • This is ideal for most users.
  • unstable: Used for development, contains the latest PRs.
    • Developers should base their PRs on this branch.

Contributing

Lighthouse welcomes contributors.

If you are looking to contribute, please head to the Contributing section of the Lighthouse book.

Contact

The best place for discussion is the Lighthouse Discord server.

Sign up to the Lighthouse Development Updates mailing list for email notifications about releases, network status and other important information.

Encrypt sensitive messages using our PGP key.

Donations

Lighthouse is an open-source project and a public good. Funding public goods is hard and we're grateful for the donations we receive from the community via:

  • Gitcoin Grants.
  • Ethereum address: 0x25c4a76E7d118705e7Ea2e9b7d8C59930d8aCD3b (donation.sigmaprime.eth).