Ethereum consensus client in Rust
Go to file
Adam Szkoda 9c3f76a33b
Prune abandoned forks (#916)
* Address compiler warning

* Prune abandoned fork choice forks

* New approach to pruning

* Wrap some block hashes in a newtype pattern

For increased type safety.

* Add Graphviz chain dump emitter for debugging

* Fix broken test case

* Make prunes_abandoned_forks use real DiskStore

* Mark finalized blocks in the GraphViz output

* Refine debug stringification of Slot and Epoch

Before this commit: print!("{:?}", Slot(123)) == "Slot(\n123\n)".
After this commit: print!("{:?", Slot(123)) == "Slot(123)".

* Simplify build_block()

* Rewrite test case using more composable test primitives

* Working rewritten test case

* Tighten fork prunning test checks

* Add another pruning test case

* Bugfix: Finalized blocks weren't always properly detected

* Pruning: Add pruning_does_not_touch_blocks_prior_to_finalization test case

* Tighten pruning tests: check if heads are tracked properly

* Add a failing test case for a buggy scenario

* Change name of function to a more accurate one

* Fix failing test case

* Test case: Were skipped slots' states pruned?

* Style fix: Simplify dereferencing

* Tighten pruning tests: check if abandoned states are deleted

* Towards atomicity of db ops

* Correct typo

* Prune also skipped slots' states

* New logic for handling skipped states

* Make skipped slots test pass

* Post conflict resolution fixes

* Formatting fixes

* Tests passing

* Block hashes in Graphviz node labels

* Removed unused changes

* Fix bug with states having < SlotsPerHistoricalRoot roots

* Consolidate State/BlockRootsIterator for pruning

* Address review feedback

* Fix a bug in pruning tests

* Detach prune_abandoned_forks() from its object

* Move migrate.rs from store to beacon_chain

* Move forks pruning onto a background thread

* Bugfix: Heads weren't pruned when prune set contained only the head

* Rename: freeze_to_state() -> process_finalization()

* Eliminate redundant function parameter

Co-authored-by: Michael Sproul <michael@sigmaprime.io>
2020-04-20 19:59:56 +10:00
.github Use checked arithmetic in types and state proc (#1009) 2020-04-20 12:35:11 +10:00
account_manager Ensure deposits are generated with correct fork (#855) 2020-02-25 09:01:32 +11:00
beacon_node Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
book Fix issues with testnet dir, update docs (#992) 2020-04-17 17:49:29 +10:00
eth2 Prune abandoned forks (#916) 2020-04-20 19:59:56 +10:00
lcli Protect against OOB offset in variable list SSZ decoding (#974) 2020-04-20 15:35:47 +10:00
lighthouse Fix issues with testnet dir, update docs (#992) 2020-04-17 17:49:29 +10:00
scripts Eth1 Integration (#542) 2019-11-15 14:47:51 +11:00
tests make sync sim end faster by checking sync every epoch (#986) 2020-04-06 17:04:06 +10:00
validator_client Fix issues with testnet dir, update docs (#992) 2020-04-17 17:49:29 +10:00
.dockerignore Bump docker rust version (#794) 2020-01-10 16:49:16 +11:00
.editorconfig Add editorconfig template 2019-03-11 15:09:57 +11:00
.gitignore Add Cargo.lock (#684) 2019-12-09 22:39:44 +11:00
.gitmodules Replace EF tests submodule with a makefile 2019-09-08 04:19:54 +10:00
Cargo.lock Use checked arithmetic in types and state proc (#1009) 2020-04-20 12:35:11 +10:00
Cargo.toml Use checked arithmetic in types and state proc (#1009) 2020-04-20 12:35:11 +10:00
CONTRIBUTING.md Update CONTRIBUTING.md (#751) 2020-01-03 10:45:53 +11:00
Dockerfile Use --locked, upgrade Dockerfile Rust version (#894) 2020-03-05 12:50:24 +11:00
LICENSE Update License to Apache 2.0 2019-04-15 16:47:35 +10:00
Makefile Use checked arithmetic in types and state proc (#1009) 2020-04-20 12:35:11 +10:00
README.md Update to spec v0.11 (#959) 2020-04-01 22:03:03 +11:00

Lighthouse: Ethereum 2.0

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

Build Status Book Status RustDoc Status Chat Badge Swagger Badge

Documentation

terminalize

Overview

Lighthouse is:

  • Fully open-source, licensed under Apache 2.0.
  • Security-focused. Fuzzing has begun and security reviews are planned for late-2019.
  • 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 and private individuals.
  • Actively involved in the specification and security analysis of the emerging Ethereum 2.0 specification.

Like all Ethereum 2.0 clients, Lighthouse is a work-in-progress.

Development Status

Current development overview:

  • Specification v0.11.1 implemented, optimized and passing test vectors.
  • Rust-native libp2p with Gossipsub and Discv5.
  • RESTful JSON API via HTTP server.
  • Events via WebSocket.
  • Metrics via Prometheus.

Roadmap

  • April 2019: Inital single-client testnets.
  • September 2019: Inter-operability with other Ethereum 2.0 clients.
  • ~~ Q1 2020: lighthouse-0.1.0 release: All major phase 0 features implemented.~~
  • Q1 2020: Public, multi-client testnet with user-facing functionality.
  • Q2 2020: Third-party security review.
  • Q3 2020: Production Beacon Chain testnet (tentative).

Documentation

The Lighthouse Book contains information for testnet users and developers.

Code documentation is generated via cargo doc and hosted at lighthouse-docs.sigmaprime.io.

If you'd like some background on Sigma Prime, please see the Lighthouse Update #00 blog post or sigmaprime.io.

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. Alternatively, you may use the sigp/lighthouse gitter.

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).